Yes, it is clear now: 1. It works if before the request there is one persisted entity of type A and in the request all entities of type A are deleted (out of transaction) and two entities of type A are persisted (out of transaction). 2. It fails if before the request entity of type A has never been persisted and in the request two entities of type A are persisted (out of transaction) - fails with the above exception.
Looks like a bug (not fatal). I will add this description to the issue, I raised yesterday (issue 117). On Aug 27, 2:20 pm, eddyd <[email protected]> wrote: > I can not reproduce the problem in simple code. By the way the full- > size code also works, when uploaded. Anyway it consistently fails on > the development server - in one and the same way. If the above log > does not say enough, I will have to investigate more. > > On Aug 27, 6:49 am, "Jason (Google)" <[email protected]> wrote: > > > If I'm reading your logs correctly, you should be able to add both entities > > since you're supposedly not operating inside of a transaction. Can you post > > your full test code? > > > - Jason > > > On Tue, Aug 25, 2009 at 3:50 AM, eddyd <[email protected]> wrote: > > > > This happens on the development server, using JPA. In the request > > > there are: > > > > 1. transaction.begin; run query; transaction.commit; log > > > (transaction.isActive) > > > 2. (w/o transaction) delete entry; log(transaction.isActive) > > > 3. (w/o transaction) add entry; log(transaction.isActive) > > > 4. (w/o transaction) add entry; log(transaction.isActive) > > > 5. log(transaction.isActive); close connection (i.e. close > > > entityManager) > > > > And "close connection" fails, because it tries to commit a > > > transaction, which fails because there are two entities in different > > > entity groups - see the messages bellow. And at any point the logs > > > show "transaction.isActive::false". > > > My question - why at "close connection" does it try to commit, if > > > there is no active transaction?? > > > > ============== > > > Aug 25, 2009 9:56:50 AM > > > com.mound.flexiview.fvstory.StoryEntryRepositoryJPA list > > > Entries > > > INFO: story::listEntries::transaction.isActive::false > > > Aug 25, 2009 9:56:50 AM > > > com.mound.flexiview.fvstory.StoryEntryRepositoryJPA dele > > > teEntries > > > INFO: story::deleteEntries::transaction.isActive::false > > > Aug 25, 2009 9:56:50 AM > > > com.mound.flexiview.fvstory.StoryEntryRepositoryJPA addE > > > ntry > > > INFO: story::addEntry::transaction.isActive::false > > > Aug 25, 2009 9:56:50 AM > > > com.mound.flexiview.fvstory.StoryEntryRepositoryJPA addE > > > ntry > > > INFO: story::addEntry::transaction.isActive::false > > > Aug 25, 2009 9:56:50 AM com.mound.flexiview.db.DBManagerJPA > > > closeConnection > > > INFO: closeConnection::transaction.isActive::false > > > Aug 25, 2009 9:56:50 AM com.mound.flexiview.db.DBManagerJPA > > > closeConnection > > > WARNING: closeConnection failed (close):: > > > javax.persistence.PersistenceException: Illegal argument > > > at > > > org.datanucleus.jpa.NucleusJPAHelper.getJPAExceptionForJDOException(N > > > ucleusJPAHelper.java:214) > > > at org.datanucleus.jpa.EntityManagerImpl.close > > > (EntityManagerImpl.java:15 > > > 7) > > > at > > > org.datanucleus.store.appengine.jpa.DatastoreEntityManager.close(Data > > > storeEntityManager.java:54) > > > at com.mound.flexiview.db.DBManagerJPA.closeConnection(Unknown > > > Source) > > > at com.mound.flexiview.db.DBPhaseListener.afterPhase(Unknown > > > Source) > > > at com.sun.faces.lifecycle.Phase.handleAfterPhase(Phase.java: > > > 179) > > > at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:103) > > > > ........... > > > > Caused by: java.lang.IllegalArgumentException: can't operate on > > > multiple entity > > > groups in a single transaction. found both > > > com.google.appengine.api.datastore.de > > > v.localdatastoreservice$profile$entitygr...@1bd427 and > > > com.google.appengine.api. > > > datastore.dev.localdatastoreservice$profile$entitygr...@1054f93 > > > at > > > com.google.appengine.api.datastore.DatastoreApiHelper.translateError( > > > DatastoreApiHelper.java:29) > > > at > > > com.google.appengine.api.datastore.DatastoreApiHelper.makeSyncCall(Da > > > tastoreApiHelper.java:56) > > > at com.google.appengine.api.datastore.DatastoreServiceImpl > > > $2.run(Datasto > > > reServiceImpl.java:169) > > > at > > > com.google.appengine.api.datastore.TransactionRunner.runInTransaction > > > (TransactionRunner.java:30) > > > at com.google.appengine.api.datastore.DatastoreServiceImpl.put > > > (Datastore > > > ServiceImpl.java:157) > > > at com.google.appengine.api.datastore.DatastoreServiceImpl.put > > > (Datastore > > > ServiceImpl.java:137) > > > at com.google.appengine.api.datastore.DatastoreServiceImpl.put > > > (Datastore > > > ServiceImpl.java:133) > > > at > > > org.datanucleus.store.appengine.RuntimeExceptionWrappingDatastoreServ > > > ice.put(RuntimeExceptionWrappingDatastoreService.java:104) > > > at > > > org.datanucleus.store.appengine.DatastorePersistenceHandler.put(Datas > > > torePersistenceHandler.java:125) > > > at > > > org.datanucleus.store.appengine.DatastorePersistenceHandler.put(Datas > > > torePersistenceHandler.java:94) > > > at > > > org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObj > > > ect(DatastorePersistenceHandler.java:195) > > > at > > > org.datanucleus.state.JDOStateManagerImpl.internalMakePersistent(JDOS > > > tateManagerImpl.java:3185) > > > at org.datanucleus.state.JDOStateManagerImpl.flush > > > (JDOStateManagerImpl.j > > > ava:4513) > > > at org.datanucleus.ObjectManagerImpl.flushInternal > > > (ObjectManagerImpl.jav > > > a:2814) > > > at org.datanucleus.ObjectManagerImpl.flush > > > (ObjectManagerImpl.java:2754) > > > at org.datanucleus.ObjectManagerImpl.preCommit > > > (ObjectManagerImpl.java:28 > > > 93) > > > at org.datanucleus.TransactionImpl.internalPreCommit > > > (TransactionImpl.jav > > > a:369) > > > at org.datanucleus.TransactionImpl.commit(TransactionImpl.java: > > > 256) > > > at org.datanucleus.ObjectManagerImpl.close > > > (ObjectManagerImpl.java:801) > > > at org.datanucleus.jdo.JDOPersistenceManager.close > > > (JDOPersistenceManager > > > .java:271) > > > at org.datanucleus.jpa.EntityManagerImpl.close > > > (EntityManagerImpl.java:15 > > > 3) > > > > ............ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine for Java" 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-java?hl=en -~----------~----~----~----~------~----~------~--~---
