257 words

Upgrade to 2.4.1_03

#1
2012-07-05 04:51

Right, that fix to 2.4.1_02 got us past the previous issue. Now I'm not sure whether this next issue is our annotations, or another issue with objectdb. I have added some more classes to the unit test. They are used by AbstractContactDetail.

On line 372 of the attached test, AbstractContactDetail extends AttributeHolder. If I remove the extends, the test passes. If I add it, it fails. I'm not even adding anything to AttributeHolder as part of this test.

The exception I get with the extends is:

[ObjectDB 2.4.1_03] javax.persistence.PersistenceException
Failed to clear field property com.contextspace.AddressTest$ElectronicAddress.domain 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$ElectronicAddress.domain 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:509)
at com.objectdb.o.MMM.ab(MMM.java:953)
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.reflect.InvocationTargetException
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:1363)
at com.objectdb.o.UMR$Z.w(UMR.java:1357)
at com.objectdb.o.UMR.v(UMR.java:523)
... 36 more
Caused by: java.lang.NullPointerException: Name is null
at java.lang.Enum.valueOf(Enum.java:195)
at com.contextspace.AddressTest$InstantMessagingAddress$IM_PROVIDERS.valueOf(AddressTest.java:1)
at com.contextspace.AddressTest$InstantMessagingAddress.validateDomain(AddressTest.java:718)
at com.contextspace.AddressTest$InstantMessagingAddress.setDomain(AddressTest.java:694)
... 43 more
pedwards
pedwards's picture
Joined on 2011-06-06
User Post #31
#2
2012-07-05 16:29

This and the previous problem result from the way that ObjectDB builds a new entity object for merge, which includes clearing the new constructed object. In this specific test case clearing the domain field to null conflicts with your checks.

To solve this problem build 2.4.1_04 avoids this clearing operation.

The clearing was added to solve another problem (of duplicating objects during merge). Actions have been taken now to solve that other problem in a different way but a regression is possible.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #1,143
#3
2012-07-06 01:54

That seems to have got it.

Thanks

pedwards
pedwards's picture
Joined on 2011-06-06
User Post #32

Post Reply

Please read carefully the posting instructions - before posting to the ObjectDB website.

  • You may have to disable pop up blocking in order to use the toolbar (e.g. in Chrome).
  • Use ctrl + right click to open the browser context menu in the editing area (e.g. for using a browser spell checker).
  • To insert formatted lines (e.g. Java code, stack trace) - select a style in the toolbar and then insert the text in the new created block.
  • Avoid overflow of published source code examples by breaking long lines.
  • You may mark in paragraph code words (e.g. class names) with the code style (can be applied by ctrl + D).
  • Long stack traces (> 50 lines) and complex source examples (> 100 lines) should be posted as attachments.
Attachments:
Maximum file size: 32 MB
Cancel