Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8038689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T03:19:06+00:00 2026-06-05T03:19:06+00:00

I am developing in Google App Engine since one year ago and I am

  • 0

I am developing in Google App Engine since one year ago and I am understanding how important is the warmup time for instances.
So I ended up with an idea: is it possible to cache singleton in memcache? For example I am using the singleton pattern for JDO PersistenceManagerFactory.

Here is my actual code (as described in documentation):

    private static PersistenceManagerFactory pmfInstance = JDOHelper.getPersistenceManagerFactory(<my-name>);

Does it have any sense something like extend the JDOHelper and write a function like this one:

public static PersistenceManagerFactory getPersistenceManagerFactoryCached(String name) {
    MemcacheService cache = MemcacheServiceFactory.getMemcacheService();;
    PersistenceManagerFactory staticPMF= null;
    if (cache.contains("JDO_PMF")) {
        staticPMF = (PersistenceManagerFactory) cache.get("JDO_PMF");
    } else {
        staticPMF = JDOHelper.getPersistenceManagerFactory(name);
        cache.put("JDO_PMF", staticPMF);
    }
    return staticPMF;
}

My idea should be to cache the PersistenceManagerFactory to speed-up the first instance and then use this one as the singleton:

private static PersistenceManagerFactory pmfInstance = JDOHelperCached.getPersistenceManagerFactory(<my-name>);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T03:19:08+00:00Added an answer on June 5, 2026 at 3:19 am

    Edit: Just found this link, seems different instances cannot share PersistenceManagerFactory instance according to Ikai Lan at https://groups.google.com/group/google-appengine-java/browse_thread/thread/1b90fae408b52d49

    ==========================================================================

    I like the idea, and I have tried straight away on my code, but unfortunately I got some error like this:

    javax.jdo.JDOFatalUserException: No available StoreManager found for the datastore URL key "". Please make sure you have all relevant plugins in the CLASSPATH (e.g datanucleus-rdbms?, datanucleus-db4o?), and consider setting the persistence property "datanucleus.storeManagerType" to the type of store you are using e.g rdbms, db4o
    

    Maybe it’s only my issue but I can’t tell at this stage.

    I have thought about this more:

    So let’s assume the way you suggest is working and you can get the right factory you need. The real performance will depend on how you use your memcache.

    1) If you have a lot of write in your memcache, then that means potentially the PersistenceManagerFactory may be kicked out of the cache frequently, which means you need to create it again.

    2) Every time you create a new PersistenceManagerFactory, you will put in into the cache which according to my experience dealing with GAE is pretty unstable and sometimes the put in part can take much longer than you expected.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm in the middle of developing an app on Google's App Engine, and one
I'm developing software on google app engine. I'm using the webapp framework. is there
I'm developing a REST google app engine application. I want to know if it's
I'm considering developing an app for Google App Engine, which should not get too
I've been developing a Facebook app using Google App Engine in Python and the
I am developing a website using Google App Engine and Django 1.0 (app-engine-patch) A
I am developing one app , which is required to integrate Google checkout.I am
I'm developing in Google App Engine (python sdk) and I want to use jQuery
I am developing an application on the Google App Engine using Python (and Django,
I'm developing an application for Google App Engine which uses BigTable for its datastore.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.