Issue Details (XML | Word | Printable)

Key: NUCRDBMS-647
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Ludovic Galibert
Votes: 0
Watchers: 0
Operations

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 datanucleus-jdoversion-testcase.zip (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.store.rdbms.request.UpdateRequest.execute(UpdateRequest.java:363)
at org.datanucleus.store.rdbms.RDBMSPersistenceHandler.updateTable(RDBMSPersistenceHandler.java:410)
at org.datanucleus.store.rdbms.RDBMSPersistenceHandler.updateObject(RDBMSPersistenceHandler.java:383)
at org.datanucleus.state.JDOStateManager.flush(JDOStateManager.java:3728)
at org.datanucleus.ExecutionContextImpl.flushInternalWithOrdering(ExecutionContextImpl.java:3994)
at org.datanucleus.ExecutionContextImpl.flushInternal(ExecutionContextImpl.java:3917)
at org.datanucleus.ExecutionContextImpl.flush(ExecutionContextImpl.java:3859)
at org.datanucleus.ExecutionContextImpl.preCommit(ExecutionContextImpl.java:4247)
at org.datanucleus.ExecutionContextImpl.transactionPreCommit(ExecutionContextImpl.java:564)
at org.datanucleus.TransactionImpl.internalPreCommit(TransactionImpl.java:397)
at org.datanucleus.TransactionImpl.commit(TransactionImpl.java:286)
at org.datanucleus.api.jdo.JDOTransaction.commit(JDOTransaction.java:98)
at org.datanucleus.test.Main.main(Main.java:49)

Ludovic Galibert made changes - 08/Jan/13 02:04 PM
Field Original Value New Value
Attachment datanucleus-jdoversion-testcase.zip [ 11850 ]
Andy Jefferson made changes - 12/Feb/13 03:04 PM
Project DataNucleus Core [ 10143 ] DataNucleus Store RDBMS [ 10144 ]
Key NUCCORE-982 NUCRDBMS-647
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 ]