MountainClimb / datanucleus-appengine

Automatically exported from code.google.com/p/datanucleus-appengine
0 stars 0 forks source link

deletePersistentAll() throws FatalNucleusUserException #249

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. use deletePersistentAll() to delete entities as seen in the following code 
snippet.
2. the problem experienced only in the GAE infrastructure and not in the local 
development environment.

PersistenceManager pm = pmf.get().getPersistenceManager();
Transaction tx = pm.currentTransaction();
long deleted = 0;

try {
  tx.begin();
  Query query = pm.newQuery(RawResult.class, "dateTime < :threshold");
  deleted = query.deletePersistentAll(new Object[] { threshold });
  tx.commit();
} finally {
   if (tx.isActive()) {
     tx.rollback();
   }
   pm.close();
}

What is the expected output? What do you see instead?

The selected entities should be deleted.
Instead the following exception is received:

Illegal argument
org.datanucleus.store.appengine.FatalNucleusUserException: Illegal argument
    at org.datanucleus.store.appengine.DatastoreExceptionTranslator.wrapIllegalArgumentException(DatastoreExceptionTranslator.java:43)
    at org.datanucleus.store.appengine.RuntimeExceptionWrappingDatastoreService.delete(RuntimeExceptionWrappingDatastoreService.java:156)
    at org.datanucleus.store.appengine.DatastorePersistenceHandler.delete(DatastorePersistenceHandler.java:224)
    at org.datanucleus.store.appengine.DatastorePersistenceHandler.deleteObject(DatastorePersistenceHandler.java:670)
    at org.datanucleus.state.JDOStateManagerImpl.internalDeletePersistent(JDOStateManagerImpl.java:4198)
    at org.datanucleus.state.JDOStateManagerImpl.deletePersistent(JDOStateManagerImpl.java:4166)
    at org.datanucleus.ObjectManagerImpl.deleteObjectInternal(ObjectManagerImpl.java:1470)
    at org.datanucleus.ObjectManagerImpl.deleteObject(ObjectManagerImpl.java:1395)
    at org.datanucleus.ObjectManagerImpl.deleteObjects(ObjectManagerImpl.java:1534)
    at org.datanucleus.store.query.Query.performDeletePersistentAll(Query.java:1881)
    at org.datanucleus.store.query.AbstractJavaQuery.performDeletePersistentAll(AbstractJavaQuery.java:136)
    at org.datanucleus.store.query.Query.deletePersistentAll(Query.java:1832)
    at org.datanucleus.store.query.Query.deletePersistentAll(Query.java:1780)
    at org.datanucleus.jdo.JDOQuery.deletePersistentAll(JDOQuery.java:180)

What version of the product are you using? On what operating system?

datanucleus-core: 1.1.5
datanucleus-appengine: 1.0.9
GAE infrastructure

Original issue reported on code.google.com by palri...@gmail.com on 6 Sep 2011 at 9:27

GoogleCodeExporter commented 8 years ago

Original comment by googleco...@yahoo.co.uk on 21 Sep 2011 at 3:53

GoogleCodeExporter commented 8 years ago
Can't reproduce with SVN trunk. Pls demonstrate it with a complete testcase

Original comment by googleco...@yahoo.co.uk on 1 Nov 2011 at 4:21