Issue Details (XML | Word | Printable)

Key: NUCRDBMS-503
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Andy Jefferson
Votes: 0
Watchers: 0
Operations

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

Map<PC, PC> with dependent key/value on delete of owner when optimistic txn can cause error

Created: 23/Feb/11 08:04 PM   Updated: 23/Feb/11 08:04 PM
Component/s: ORM
Affects Version/s: None
Fix Version/s: None


 Description  « Hide
Look at "test.jdo.application" DependentFieldTest "testDependentFieldsInverseMapsDeletion".
This passes when using pessimistic transactions, but when switching to optimistic it causes

testDependentFieldsInverseMapsDeletion(org.datanucleus.tests.DependentFieldTest) Time elapsed: 0.463 sec <<< ERROR!
javax.jdo.JDOUserException: Cannot write fields to a deleted object
FailedObject:2
        at org.datanucleus.api.jdo.state.PersistentDeleted.transitionWriteField(PersistentDeleted.java:126)
        at org.datanucleus.state.AbstractStateManager.transitionWriteField(AbstractStateManager.java:584)
        at org.datanucleus.state.JDOStateManagerImpl.preWriteField(JDOStateManagerImpl.java:4662)
        at org.datanucleus.state.JDOStateManagerImpl.setObjectField(JDOStateManagerImpl.java:2625)
        at org.datanucleus.state.JDOStateManagerImpl.setObjectField(JDOStateManagerImpl.java:2521)
        at org.datanucleus.store.mapped.scostore.FKMapStore.removeValue(FKMapStore.java:701)
        at org.datanucleus.store.mapped.scostore.FKMapStore.remove(FKMapStore.java:658)
        at org.datanucleus.store.mapped.scostore.FKMapStore.clear(FKMapStore.java:734)
        at org.datanucleus.store.types.sco.queued.ClearMapOperation.perform(ClearMapOperation.java:35)
        at org.datanucleus.store.types.sco.queued.ClearMapOperation.perform(ClearMapOperation.java:26)
        at org.datanucleus.store.types.sco.queued.OperationQueue.performAll(OperationQueue.java:137)
        at org.datanucleus.store.types.sco.backed.HashMap.flush(HashMap.java:248)
        at org.datanucleus.store.mapped.mapping.MapMapping.preDelete(MapMapping.java:250)
        at org.datanucleus.store.rdbms.request.DeleteRequest.execute(DeleteRequest.java:178)
        at org.datanucleus.store.rdbms.RDBMSPersistenceHandler.deleteTable(RDBMSPersistenceHandler.java:492)
        at org.datanucleus.store.rdbms.RDBMSPersistenceHandler.deleteObject(RDBMSPersistenceHandler.java:461)
        at org.datanucleus.state.JDOStateManagerImpl.internalDeletePersistent(JDOStateManagerImpl.java:4518)
        at org.datanucleus.state.JDOStateManagerImpl.flush(JDOStateManagerImpl.java:4868)
        at org.datanucleus.ObjectManagerImpl.flushInternal(ObjectManagerImpl.java:3227)
        at org.datanucleus.ObjectManagerImpl.flush(ObjectManagerImpl.java:3167)
        at org.datanucleus.ObjectManagerImpl.preCommit(ObjectManagerImpl.java:3308)

So it gets to the remove method where it will check on dependent key/value but then tries to delete the value. Probably needs to flush things to the datastore first

Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.