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(

Sort Order: Ascending order - Click to sort in descending order
Andy Jefferson added a comment - 12/Feb/13 03:06 PM
SVN trunk passes on this test