Transactions are only supported across a single entity group. So you cannot do what you want, unless you change your relationship to be an owned relationship which would put the objects in the same entity group.
On Apr 10, 6:27 pm, AdamM <[email protected]> wrote: > Hi, > > I am developing an application, that operates on multiple entity > groups in multiple datastore transactions. > > I first create a PersistenceManager and open a transaction on it.I > make an object persistent using this transaction, but I do not commit > it. After this I create a new PersistenceManager with a transaction > from the same factory, I make persistent an object to a different > entity group. Again I do not commit. At the end I will commit the > transaction after each other. > > There is a foreign key relationship between the 2 objects (I store the > Object with primary key first). > > The second transaction fails to commit with an Exception: > > NestedThrowablesStackTrace: > java.lang.IllegalStateException: Attempted to deregister a transaction > that is not currently registered. > at > com.google.appengine.api.datastore.TransactionStackImpl.remove(TransactionStackImpl.java: > 61) > at > com.google.appengine.api.datastore.TransactionImpl.commit(TransactionImpl.java: > 71) > at > org.datanucleus.store.appengine.DatastoreTransaction.commit(DatastoreTransaction.java: > 61) > at > org.datanucleus.store.appengine.DatastoreXAResource.commit(DatastoreXAResource.java: > 88) > (I do not get this error, if I leave the persistence of the object out > from the 2nd transaction.) > > I was running this code both from JUnit Tests and on Local App Engine > instance. > > This was working with 1.2.6 or 1.3.0 but not with 1.3.2. > > I also have a JUnit Test to test concurrent modification, I used to > get JDOCanRetryException on concurrent changes, but now with the new > version I am getting: > > java.util.ConcurrentModificationException: too much contention on > these datastore entities. please try again. > at > com.google.appengine.api.datastore.DatastoreApiHelper.translateError(DatastoreApiHelper.java: > 37) > at > com.google.appengine.api.datastore.DatastoreApiHelper.makeSyncCall(DatastoreApiHelper.java: > 63) > at > com.google.appengine.api.datastore.TransactionImpl.makeSyncCall(TransactionImpl.java: > 42) > at > com.google.appengine.api.datastore.TransactionImpl.makeSyncCall(TransactionImpl.java: > 56) > at > com.google.appengine.api.datastore.TransactionImpl.commit(TransactionImpl.java: > 66) > > Has anything changed in 1.3.2? > > Please help. > > Regards, > > Adam -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
