Upgrade to 2.4.1_01

#1

Hi,

We tried to upgrade from 2.3.7_18 to 2.4.1_01 to pickup some fixes. We discovered that our code no longer works when using 2.4.1_01. We did some probing and found one thing. I have attached the unit test to display this issue.

The problem seems to be the annotation at line 266 in the test. In our code for 2.3.7_18, we had @OneToOne(cascade=CascadeType.ALL, fetch=FetchType.EAGER), which is wrong, as Contactdetails is Embeddable, the annotation should be @Embedded. Neither annotation works with 2.4.1_01, with each giving a different error.

@Embedded  gives:

[ObjectDB 2.4.1_01] javax.persistence.PersistenceException
Attempt to persist a reference to a non managed com.contextspace.AddressTest$Address instance - property com.contextspace.AddressTest$ContactDetails.addresses - property com.contextspace.AddressTest$CDI.contactDetails (error 637)
at com.objectdb.jpa.EMImpl.merge(EMImpl.java:454)
at com.contextspace.AddressTest.test(AddressTest.java:94)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: com.objectdb.o.UserException: Attempt to persist a reference to a non managed com.contextspace.AddressTest$Address instance - property com.contextspace.AddressTest$ContactDetails.addresses - property com.contextspace.AddressTest$CDI.contactDetails
at com.objectdb.o.MSG.d(MSG.java:61)
at com.objectdb.o.TYW.writeElement(TYW.java:292)
at com.objectdb.o.ABT.writeArray(ABT.java:550)
at com.objectdb.o.CLT.writeStrictly(CLT.java:195)
at com.objectdb.o.TYW.at(TYW.java:428)
at com.objectdb.o.TYW.av(TYW.java:478)
at com.objectdb.o.TYW.writeElement(TYW.java:305)
at com.objectdb.o.UMR$P.y(UMR.java:964)
at com.objectdb.o.UMR.x(UMR.java:553)
at com.objectdb.o.UML.u(UML.java:515)
at com.objectdb.o.MMM.af(MMM.java:1033)
at com.objectdb.o.UTY.writeStrictly(UTY.java:1314)
at com.objectdb.o.TYW.at(TYW.java:428)
at com.objectdb.o.TYW.writeElement(TYW.java:297)
at com.objectdb.o.UMR$P.y(UMR.java:964)
at com.objectdb.o.UMR.x(UMR.java:553)
at com.objectdb.o.UML.u(UML.java:515)
at com.objectdb.o.MMM.af(MMM.java:1033)
at com.objectdb.o.UTY.aG(UTY.java:1201)
at com.objectdb.o.EMR.s(EMR.java:251)
at com.objectdb.o.EMR.q(EMR.java:79)
at com.objectdb.jpa.EMImpl.merge(EMImpl.java:451)
... 24 more

@OneToOne gives:

[ObjectDB 2.4.1_01] javax.persistence.PersistenceException
Failed to clear field property com.contextspace.AddressTest$AbstractContactDetail.primary using reflection (error 363)
at com.objectdb.jpa.EMImpl.merge(EMImpl.java:454)
at com.contextspace.AddressTest.test(AddressTest.java:93)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: com.objectdb.o.UserException: Failed to clear field property com.contextspace.AddressTest$AbstractContactDetail.primary using reflection
at com.objectdb.o.MSG.d(MSG.java:74)
at com.objectdb.o.UMR.M(UMR.java:896)
at com.objectdb.o.UMR.v(UMR.java:526)
at com.objectdb.o.UML.t(UML.java:501)
at com.objectdb.o.MMM.ab(MMM.java:951)
at com.objectdb.o.UTY.aE(UTY.java:1145)
at com.objectdb.o.EMR.h(EMR.java:175)
at com.objectdb.o.TVS.Un(TVS.java:185)
at com.objectdb.o.CLT.visitRefs(CLT.java:160)
at com.objectdb.o.TVS.j(TVS.java:169)
at com.objectdb.o.TVS.cascade(TVS.java:156)
at com.objectdb.o.TVS.g(TVS.java:105)
at com.objectdb.o.TVS.g(TVS.java:93)
at com.objectdb.o.EMR.q(EMR.java:76)
at com.objectdb.jpa.EMImpl.merge(EMImpl.java:451)
... 24 more
Caused by: java.lang.IllegalArgumentException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.objectdb.o.UMR$Z.C(UMR.java:1346)
at com.objectdb.o.UMR$P.w(UMR.java:952)
at com.objectdb.o.UMR.v(UMR.java:523)
... 36 more

#2

Thank you for this report and for isolating the problem with a test case.

Please try build 2.4.1_02 that should fix both issues.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

Post Reply

To post a reply and/or subscribe to update notifications - please login