-
1. Re: ObjectNotFoundException for an audited optional association.
azagorneanu Dec 15, 2010 9:54 AM (in response to azagorneanu)Does anybody know what is the problem? Some hints, suggestions?
Should I open a JIRA bug for this?
Please help.
-
2. Re: ObjectNotFoundException for an audited optional association.
0x3333 Dec 20, 2010 9:01 AM (in response to azagorneanu)Hi!
I'm having the same issue here. In my case it's related to the N:1 relationship.
I have a Customer entity and this customer has a N:1 relationship with CustomerType, when I load a revision of Customer and try to get the CustomerType I get an exception:
Caused by: org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [br.com.unimaquina.erp.dynamic.MtProduto#23]at org.hibernate.impl.SessionFactoryImpl$2.handleEntityNotFound(SessionFactoryImpl.java:433)at org.hibernate.proxy.AbstractLazyInitializer.checkTargetState(AbstractLazyInitializer.java:189)at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:178)at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:215)at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:190)Caused by: org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.john.doe.Customer#23]
at org.hibernate.impl.SessionFactoryImpl$2.handleEntityNotFound(SessionFactoryImpl.java:433)
at org.hibernate.proxy.AbstractLazyInitializer.checkTargetState(AbstractLazyInitializer.java:189)
at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:178)
at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:215)
at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:190)
I think that this is a bug, I'll try to file a bug, but JIRA is down now.
-
3. Re: ObjectNotFoundException for an audited optional association.
azagorneanu Dec 20, 2010 11:53 AM (in response to 0x3333)Ok. In case you will open a bug for this, just post the JIRA bug number here, to have it as a reference.
-
4. Re: ObjectNotFoundException for an audited optional association.
fbascheper Dec 20, 2010 3:30 PM (in response to azagorneanu)Hi,
Have you verified that the row actually exists in the database (i.e. after the transaction has completed)?
If so, please provide a working testcase against the envers testsuite.
Regards,
Erik-Berndt
-
5. Re: ObjectNotFoundException for an audited optional association.
azagorneanu Dec 21, 2010 3:39 AM (in response to fbascheper)The row doesn't exists in DB because this is an optional 1:1 association. A Contact can have or can not have an Address. The Address is optional. If Contact has an address then everything is OK. In case the Contact doesn't have an Address, then while retrieving a revision for this Contact from audit tables the ObjectNotFoundException is raised when the contact address is accessed. In this case the address should be null, but instead Envers creates a proxy and tries to initialize it.
-
6. Re: ObjectNotFoundException for an audited optional association.
fbascheper Dec 21, 2010 11:09 AM (in response to azagorneanu)This looks like a bug. Could you open a Jira issue with a reproducible (TestNG) testcase?
-
7. Re: ObjectNotFoundException for an audited optional association.
azagorneanu Dec 23, 2010 7:32 AM (in response to fbascheper)I created a JIRA bug for this with an attached TestNG testcase. This is the link: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5808