I am developing a web app for GAE/J using the Wicket framework, and I
too find that my application instances often do not survive one minute
before being cycled out (I am the sole source of traffic). One effect
of this, within the app start-up delay, is that this takes out my
singleton PersistenceManagerFactory instance, so I have to recreate a
new one for many interactions with my app.


  CODE SNIPPETS
  -------------
  private static volatile PersistenceManagerFactory g_pmf = null;

  // Called before every data exchange with the datastore
  public static PersistenceManagerFactory
getPersistenceManagerFactory()
  {
    if (g_pmf == null)
      synchronized (DataExchange.class)    // Non-GAE class
      {
        if (g_pmf == null)
        {
          loadProperties();    // Non-GAE method
          g_pmf =
JDOHelper.getPersistenceManagerFactory(g_sDatabaseMode);
        }
      }

    return g_pmf;
  }

-- 
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.

Reply via email to