← Back to team overview

mugle-dev team mailing list archive

Re: Using the persistence Manager many times in one method

 

On that note, dont use them in a for loop either;
I'm going through and having to change many of the ServerSideImpl to use
ModelClass.getObject(key.getID()) rather than ModelClass.getObject(pm, key)
so that the server doesnt crash

On Sun, May 22, 2011 at 9:55 PM, Scott Ritchie <s.ritchie73@xxxxxxxxx>wrote:

> Yeah i couldnt figure it out - but in DataStoreServiceImpl (and all methods
> it called), it just crashed inside GameFile.create() when you tried to do
> pm.newQuery() throwing JDOFatalUserException, and was resolved by using the
> GetterMethods which handled the PersistenceManager by themselves (rather
> than passing the one around).
>
> If i had to guess i'd say that theres a certain amount of time between
> writes to the database, so if you keep the persistence manager open for long
> enough it goes beyond this and wont make any more queries.
>
> To be honest the only time i see this ever being a problem is in the
> DataServiceImpl.
>
>
> On Sun, May 22, 2011 at 9:49 PM, Matt Giuca <matt.giuca@xxxxxxxxx> wrote:
>
>> That doesn't sound very scientific. We should either have a policy on
>> using it once per transaction, or not at all. And try to get to the bottom
>> of it.
>>
>> But not tonight :(
>>
>
>

Follow ups

References