Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] resource.delete() fails for HibernateStore with Nullability-Exception
[CDO] resource.delete() fails for HibernateStore with Nullability-Exception [message #1720126] Thu, 14 January 2016 15:09 Go to next message
Alexander Nehmer is currently offline Alexander NehmerFriend
Messages: 19
Registered: January 2016
Junior Member
Hello *,

we are currently developing an EMF application with an CDO backend. After the initial phase I switched the DBStore (H2) backend to Hibernate with Oracle, but I encountered some difficulties. The last unresolved one is the deletion of a resource.

When I call
resource.delete(null) 
and do a
cdoTransaction.commit()
afterwards I receive the following exception:
Caused by: org.eclipse.emf.cdo.util.CommitException: Rollback in HibernateStore: org.hibernate.PropertyValueException: not-null property references a null or transient value : BaseComponentStage.developmentStage
	at org.hibernate.engine.internal.Nullability.checkNullability(Nullability.java:106)
	at org.hibernate.event.internal.DefaultDeleteEventListener.deleteEntity(DefaultDeleteEventListener.java:279)
	at org.hibernate.event.internal.DefaultDeleteEventListener.onDelete(DefaultDeleteEventListener.java:160)
	at org.hibernate.internal.SessionImpl.fireDelete(SessionImpl.java:929)


The BaseComponent type has a reference on a DevelopmentStage instance with a upper and lower bound of 1.

I tracked the problem down to Hibernate checking on an instance whose reference was already removed and hence throw an error. But why does Hibernate check during a deletion?

Am I missing something?

I don't want to determine the deletion order myself and I'm curious what happens if the deletion comes to a point where bidirectional references have to be removed as there is no correct first instance to be removed to not provoke this Nullability issue.

Thanks a lot

Alex
Re: [CDO] resource.delete() fails for HibernateStore with Nullability-Exception [message #1720180 is a reply to message #1720126] Thu, 14 January 2016 23:03 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Alex,
Truth is that the Hibernate CDO Store is not actively maintained. So it would be a bit risky to count on it. If you are interested I can always give guidance if you want to maintain it yourselve.

Checking the internet this seems indeed to be an issue with hibernate, so not necessarily related to the CDO Hibernatestore code. Indeed bidirectional references are tricky. In that case you have to change your model, make things non mandatory.

gr. Martin
Re: [CDO] resource.delete() fails for HibernateStore with Nullability-Exception [message #1720228 is a reply to message #1720180] Fri, 15 January 2016 12:37 Go to previous message
Alexander Nehmer is currently offline Alexander NehmerFriend
Messages: 19
Registered: January 2016
Junior Member
Hi Martin,

thanks for your quick reply. After a while of experimenting with the cascade setting and turning of nullability checks via Hibernate I decided to move to DBStore as long as I don't need specific Hibernate functionality. But nevertheless thanks for helping out.

Alex
Previous Topic:[Core] ItemDescriptors not displayed in the properties sheet page
Next Topic:"Filter" elements with reference to interface
Goto Forum:
  


Current Time: Sat Apr 20 03:45:10 GMT 2024

Powered by FUDForum. Page generated in 0.02917 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top