DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
Issue Details (XML | Word | Printable)

Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Ludovic Galibert
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
DataNucleus Store RDBMS

Transactional version not loaded if object has no primitive field

Created: 08/Jan/13 02:04 PM   Updated: 12/Feb/13 05:14 PM   Resolved: 12/Feb/13 03:06 PM
Component/s: Queries
Affects Version/s: 3.1.3, 3.2.0.m2
Fix Version/s: 3.2.0.m4

File Attachments: 1. Zip Archive (4 kB)

Environment: Linux, Mac OS X, Windows

Datastore: Oracle, PostgreSQL
Severity: Production

 Description  « Hide
We have an issue where updating an object resulted in an exception with the following error: "Object XXX in table a has no version set on the object in memory and you want to update it".
See below for a sample stacktrace.

After debugging and looking at the objects, we noticed that this happens if the object has no primitive field, no field will be in a default fetch group and the transactional version does not get loaded. This leads to the error mentioned above.

This can be reproduced with versions 3.0.11, 3.1.3 and 3.2.0.m2 with the attached test case.

org.datanucleus.exceptions.NucleusException: Object with id "3[OID]org.datanucleus.test.A" in table a has no version set on the object in memory and you want to update it!! Please report this bug to the developers of DataNucleus with a way of reproducing it
at org.datanucleus.state.JDOStateManager.flush(
at org.datanucleus.ExecutionContextImpl.flushInternalWithOrdering(
at org.datanucleus.ExecutionContextImpl.flushInternal(
at org.datanucleus.ExecutionContextImpl.flush(
at org.datanucleus.ExecutionContextImpl.preCommit(
at org.datanucleus.ExecutionContextImpl.transactionPreCommit(
at org.datanucleus.TransactionImpl.internalPreCommit(
at org.datanucleus.TransactionImpl.commit(
at org.datanucleus.api.jdo.JDOTransaction.commit(
at org.datanucleus.test.Main.main(

Ludovic Galibert made changes - 08/Jan/13 02:04 PM
Field Original Value New Value
Attachment [ 11850 ]
Andy Jefferson made changes - 12/Feb/13 03:04 PM
Project DataNucleus Core [ 10143 ] DataNucleus Store RDBMS [ 10144 ]
Affects Version/s 3.2.0.m2 [ 11788 ]
Affects Version/s 3.1.3 [ 11707 ]
Affects Version/s 3.0.11 [ 11534 ]
Affects Version/s 3.1.3 [ 11704 ]
Affects Version/s 3.2.0.m2 [ 11780 ]
Andy Jefferson made changes - 12/Feb/13 03:05 PM
Priority Critical [ 2 ] Major [ 3 ]
Component/s Queries [ 10142 ]
Andy Jefferson added a comment - 12/Feb/13 03:06 PM
SVN trunk passes on this test

Andy Jefferson made changes - 12/Feb/13 03:06 PM
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 3.2.0.m4 [ 11883 ]
Resolution Fixed [ 1 ]
Andy Jefferson made changes - 12/Feb/13 05:14 PM
Status Resolved [ 5 ] Closed [ 6 ]