[appengine-java] Re: Multiple PersistenceManagerFactory with Singleton?

2011-08-10 Thread Simon Knott
If that was your original code, that could definitely cause the problem - two threads can both hit that method at the same time and create a new PersistenceManager. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To view this

[appengine-java] Re: Multiple PersistenceManagerFactory with Singleton?

2011-08-10 Thread dimi
I was afraid about that.. I'm using Objectify for my future projects, so if it happens again.. I'll blame someone else :) But it still doesn't explain why only the queries on kind A went wrong... (unless there were more instances) -- You received this message because you are subscribed to

[appengine-java] Re: Multiple PersistenceManagerFactory with Singleton?

2011-08-10 Thread gk
Simon, this is equivalent public static final void a(){} and public static void a(){} - following of course not public static final int b and public static int b. On Aug 9, 5:57 pm, Simon Knott knott.si...@gmail.com wrote: Whilst I don't know what could cause this error, what makes you

[appengine-java] Re: Multiple PersistenceManagerFactory with Singleton?

2011-08-10 Thread dimi
Thanks. I should have know that things they learn you at school, don't work in real life :-) -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To view this discussion on the web visit

[appengine-java] Re: Multiple PersistenceManagerFactory with Singleton?

2011-08-09 Thread gk
Dimitry, that's a nice mystery... final on PMF doesn't seem to make a difference here. static members are implicitly final too, by the way (static and static final is equivalent). Class type inititialization (and thus static field initialization) is implicitly synchronized, so no worry there

[appengine-java] Re: Multiple PersistenceManagerFactory with Singleton?

2011-08-09 Thread Simon Knott
Whilst I don't know what could cause this error, what makes you believe that static and static final are equivalent? Static variables are in no way implicitly final. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To view this

[appengine-java] Re: Multiple PersistenceManagerFactory with Singleton?

2011-08-09 Thread dimi
gk and Simon, Thanks for you reply. After reading my own post again, I noticed I copied the wrong PMF code. I'm using this example (the mix up happened when I changed my code to the code above because I though the pmfInstance == null-check could be the problem :D) import