[appengine-java] Re: What's the right way to use PersistenceManager?

2009-12-28 Thread patr...@kodova.com
I playing around with GWT RPC & App Engine and was wondering the same thing today and I ended up using a ThreadLocal.Also I am going to do some refactoring it to make it work with dependency injection so I can reuse it in the future. Pros: * I have one PersistenceManager per RPC request. * Less

[appengine-java] Re: What's the right way to use PersistenceManager?

2009-12-08 Thread David Chandler
I've created an interface PMF: PMF.java package com.turbomanage.gwt.server; import javax.jdo.PersistenceManager; public interface PMF { PersistenceManager getPersistenceManager(); } and a default implementation that I inject via Guice into my service classes: DefaultPMF.java package co

[appengine-java] Re: What's the right way to use PersistenceManager?

2009-12-07 Thread Larry Cable
I am not sure it/there is a "right" way, but in my application I am injecting (via Spring) a (singleton) PMF into my Controller(s) (which are singletons) and instantiating a PM for each (concurrent) query/request... On Dec 4, 11:30 pm, Fan Lin wrote: > Hi, I'm new in JDO, so I think this problem