Hello, I'm writing a JUnit test case to perform race-conditions tests upon some parts of my application code.
To do that, I launch several Threads (installing the ApiProxy environment as needed with ApiProxy.setEnvironmentForCurrentThread()) that are concurrently invoking some parts of my application code. The tested code creates a cross-group(XG) transaction and do some datastore operations (some batch get and batch put) in it. In case of ConcurrentModificationException the code automatically retries, exactly as described here: http://code.google.com/appengine/docs/java/datastore/transactions.html#Uses_for_Transactions Executing the test case, I got the following Exception: java.lang.IllegalArgumentException: transaction closed at com.google.appengine.api.datastore.DatastoreApiHelper.translateError( DatastoreApiHelper.java:36) at com.google.appengine.api.datastore.DatastoreApiHelper$1.convertException( DatastoreApiHelper.java:76) at com.google.appengine.api.utils.FutureWrapper.get(FutureWrapper.java:106) at com.google.appengine.api.utils.FutureWrapper.get(FutureWrapper.java:90) at com.google.appengine.api.utils.FutureWrapper.get(FutureWrapper.java:90) at com.google.appengine.api.datastore.FutureHelper.getInternal( FutureHelper.java:72) at com.google.appengine.api.datastore.FutureHelper.quietGet( FutureHelper.java:33) at com.google.appengine.api.datastore.TransactionImpl.commit( TransactionImpl.java:105) etc... The exception is not thrown in any cases, it seems to be quite random (like most of concurrency problems in general), but it turns out that the probabilty for the exception to be thrown is depending on the number of concurrent thread, and on the number of entity groups that the code is operating on. The higher the number of concurrent threads and of entity groups, the higher the probability of exception. Do you know where does the problem comes from ? I run with the GAE SDK 1.6.1. Thank you in advance. -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine-java/-/roeb0n1jFWUJ. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.