Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.1B2
-
None
Description
An odd problem happens when building on Jenkins. E.g. this build (Java 7, HSQLDB) :
results in the following exception:
-------------------------------------------------------------------------------
Test set: org.apache.cayenne.access.NestedDataContextWriteTest
-------------------------------------------------------------------------------
Tests run: 11, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.151 sec <<< FAILURE!
testAddRemove(org.apache.cayenne.access.NestedDataContextWriteTest) Time elapsed: 0.012 sec <<< ERROR!
java.lang.NullPointerException
at org.apache.commons.collections.map.AbstractReferenceMap$ReferenceEntry.getValue(AbstractReferenceMap.java:597)
at org.apache.commons.collections.map.AbstractReferenceMap.get(AbstractReferenceMap.java:234)
at org.apache.cayenne.access.ObjectStore.postprocessAfterCommit(ObjectStore.java:417)
at org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:771)
at org.apache.cayenne.access.DataContext.commitChanges(DataContext.java:697)
at org.apache.cayenne.access.NestedDataContextWriteTest.testAddRemove(NestedDataContextWriteTest.java:632)
The code is as vanilla and single threaded as it gets:
DataContext context = createDataContext();
ObjectContext child = runtime.getContext(context);
Artist a = child.newObject(Artist.class);
a.setArtistName("X");
child.commitChanges(); // this is line 632 that causes exception
It appears that ObjectStore.objectMap somehow gets corrupted... Sure enough it is only reproducible on Jenkins, and never - locally.