Looking at the comment in
org.datanucleus.store.appengine.DatastoreManager.getDatastoreClass()
could lead one to think, there are race conditions related to
initializing the meta-data of persistent classes. Since your problem
occurs only from time to time, it could point to the same direction.

If you are using JDO, you may want to try to use the datanucleus
"Automatic Startup" mechanism (http://www.datanucleus.org/products/
accessplatform/jdo/autostart.html) to get more control over the
process of initializing the class meta data.

E.g. in jdoConfig.xml add these properties:
<property name="datanucleus.autoStartClassNames"
value="class1,class2,class3,…" />
<property name="datanucleus.autoStartMechanism" value="Classes" />

Rolf



On 4 Aug., 12:43, Pavel Lisa <[email protected]> wrote:
> From time to time, org.datanucleus.store.appengine.DatastoreTable throws a
> NullPointerException, and I have not yet figured out why or what is the
> pattern, just a few first requests fail and then all goes well.
>
> The exact line where the exception is thrown is 569:
>
> // Run callbacks for each of the element classes.
>
> for (AbstractClassMetaData elementCmd1 : elementCmds) {
>
> callbacks.put(elementCmd1.getFullClassName(),
>
> new CallBack(fmd, cmd.getFullClassName()));
>
> DatastoreTable dt =
>
> (DatastoreTable) storeMgr
>
> .getDatastoreClass(elementCmd1.getFullClassName(), clr);
>
> dt.runCallBacks(); // This line throws java.lang.NullPointerException from
> time to time
>
> if (fmd.getMappedBy() != null) {
>
> // This element type has a many-to-one pointing back.
>
> // We assume that our pk is part of the pk of the element type.
>
> dt.markFieldAsParentKeyProvider(fmd.getMappedBy());
>
> }
> }
>
> Anyone has an idea why this happens?

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