views:

30

answers:

0

Folks -- I am getting the following exception and can't explain why. The number of objects to persist are usually small (<10), but I get a DeadlineExceededException intermittently when using makepersistentall from the persistencemanager.

The http request code also handles other queries into the datastore prior to the makepersistentall call. Looking at the exception trace, it looks like there is some stuff related waiting for an object.

What is the issue and how can I solve this exception? Thanks

====

The pertinent code is

  // handle the updates
  List<InterestQueueItem> interested = getInterestedUsers(locx, locy, gamecode);  // this also results in a query into the datastore, which looks like it goes well
  List <BingoUpdate> topersisteUpdates = new ArrayList<BingoUpdate>();
     try {
   for (InterestQueueItem item: interested) {
    if (!item.getUID().equals(this.uid)) {   // no need to update the originator of the update
     BingoUpdate update = new BingoUpdate(item, screenname+" not working");
     update.setContent("some content");
     topersisteUpdates.add(update);
    }
   }
   pm.makePersistentAll(topersisteUpdates); // exception thrown here
     } finally {
      pm.close();
     }     

BingoUpdate constructor does not do much -- just getters and setters.

GetInterestedUsers is

public static List<InterestQueueItem> getInterestedUsers(float locx, float locy, String gamecode) {
List<InterestQueueItem> retVal = new ArrayList<InterestQueueItem>();
    PersistenceManager pm = PMF.get().getPersistenceManager();
Query query = pm.newQuery(InterestQueueItem.class);
    try {
        // reduce the potential set of interested folks
        query.setFilter("gamecode == thisGameCode");
        query.declareParameters("String thisGameCode");                 
        retVal.addAll((List <InterestQueueItem>) query.execute(gamecode));
        return retVal;
    } finally {
        pm.close();
    }
}

Exception is below:

Uncaught exception from servlet
com.google.apphosting.api.DeadlineExceededException: This request (61c89aa7e7f35f42) started at 2010/10/26 03:56:13.421 UTC and was still executing at 2010/10/26 03:56:42.750 UTC.
 at java.lang.Object.wait(Native Method)
 at java.lang.Object.wait(Object.java:502)
 at com.google.apphosting.runtime.AsyncFuture.get(AsyncFuture.java:54)
 at com.google.apphosting.runtime.ApiProxyImpl$AsyncApiFuture.get(ApiProxyImpl.java:412)
 at com.google.apphosting.runtime.ApiProxyImpl$AsyncApiFuture.get(ApiProxyImpl.java:244)
 at com.google.appengine.api.utils.FutureWrapper.get(FutureWrapper.java:42)
 at com.google.appengine.api.datastore.FutureHelper$CumulativeAggregateFuture.get(FutureHelper.java:136)
 at com.google.appengine.api.datastore.FutureHelper.getInternal(FutureHelper.java:71)
 at com.google.appengine.api.datastore.FutureHelper.quietGet(FutureHelper.java:32)
 at com.google.appengine.api.datastore.DatastoreServiceImpl$2.runInternal(DatastoreServiceImpl.java:115)
 at com.google.appengine.api.datastore.DatastoreServiceImpl$2.runInternal(DatastoreServiceImpl.java:112)
 at com.google.appengine.api.datastore.TransactionRunner.runInTransaction(TransactionRunner.java:31)
 at com.google.appengine.api.datastore.DatastoreServiceImpl.put(DatastoreServiceImpl.java:112)
 at org.datanucleus.store.appengine.RuntimeExceptionWrappingDatastoreService.put(RuntimeExceptionWrappingDatastoreService.java:117)
 at org.datanucleus.store.appengine.DatastorePersistenceHandler.put(DatastorePersistenceHandler.java:182)
 at org.datanucleus.store.appengine.DatastorePersistenceHandler.put(DatastorePersistenceHandler.java:127)
 at org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObjects(DatastorePersistenceHandler.java:254)
 at org.datanucleus.store.appengine.BatchPutManager.processBatchState(BatchPutManager.java:35)
 at org.datanucleus.store.appengine.BatchManager.finish(BatchManager.java:54)
 at org.datanucleus.store.appengine.jdo.DatastoreJDOPersistenceManager$BatchManagerWrapper.call(DatastoreJDOPersistenceManager.java:127)
 at org.datanucleus.store.appengine.jdo.DatastoreJDOPersistenceManager$BatchManagerWrapper.access$200(DatastoreJDOPersistenceManager.java:121)
 at org.datanucleus.store.appengine.jdo.DatastoreJDOPersistenceManager.makePersistentAll(DatastoreJDOPersistenceManager.java:98)
 at com.goodconcierge.UpdateQueueThread.run(UpdateQueueThread.java:112)
 at com.goodconcierge.BingoServerServlet.handleLeave(BingoServerServlet.java:92)
 at com.goodconcierge.BingoServerServlet.doGet(BingoServerServlet.java:24)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
 at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
 at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
 at com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:97)
 at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
 at com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
 at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
 at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
 at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
 at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
 at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
 at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
 at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
 at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
 at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:238)
 at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
 at org.mortbay.jetty.Server.handle(Server.java:326)
 at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
 at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
 at com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
 at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
 at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:135)
 at com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:261)
 at com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:8486)
 at com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:8484)
 at com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:24)
 at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:418)
 at com.google.net.rpc.impl.Server$RpcTask.runInContext(Server.java:572)
 at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:448)
 at com.google.tracing.TraceContext.runInContext(TraceContext.java:688)
 at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:326)
 at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:318)
 at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:446)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
 at java.lang.Thread.run(Thread.java:636)