openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Curtis (JIRA)" <>
Subject [jira] Updated: (OPENJPA-1630) NPE in MetaDataRepository when preloading is enabled under heavy stress.
Date Tue, 13 Apr 2010 19:38:51 GMT


Rick Curtis updated OPENJPA-1630:

    Attachment: OPENJPA-1630.patch

There are a couple of ways to fix this problem. The easiest is to always lock on the _registered
list when mutating, regardless of whether or not _locking is set.

The not so easy, but probably more correct solution is to only add classes to the _registered
list that each MDR cares about. I'm leaning toward the first solution for the 2.0.x branch
due to stability concerns and I'll investigate fixing it differently in trunk.

> NPE in MetaDataRepository when preloading is enabled under heavy stress.
> ------------------------------------------------------------------------
>                 Key: OPENJPA-1630
>                 URL:
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.2.2, 2.0.0-beta3, 2.0.0, 2.0.1, 2.1.0
>            Reporter: Rick Curtis
>            Assignee: Rick Curtis
>         Attachments: OPENJPA-1630.patch
> A timing window exists in the MetaDataRepository where the following[1] NPE can be encountered.
It is incorrect to assume that calling processRegisteredClasses at the end of preload would
process all registered classes. As it turns out, that call does process all registered classes
that this instance of the MDR cares about. The problem comes in when after the MDR is preloaded,
Entities that belong to a different PU are registered with the PCRegistry and they are added
to the _registered list. 
> [1] Caused by: java.lang.NullPointerException
>         at org.apache.openjpa.meta.MetaDataRepository.processRegisteredClasses(
>         at org.apache.openjpa.meta.ClassMetaData.getPCSubclasses(
>         at org.apache.openjpa.meta.ClassMetaData.getPCSubclassMetaDatas(
>         at org.apache.openjpa.meta.ClassMetaData.getMappedPCSubclassMetaDatas(
>         at org.apache.openjpa.jdbc.meta.ClassMapping.getMappedPCSubclassMappings(
>         at org.apache.openjpa.jdbc.meta.ClassMapping.getIndependentAssignableMappings(
>         at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeState(
>         at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(
>         at
>         at org.apache.openjpa.kernel.DelegatingStoreManager.initialize(
>         at org.apache.openjpa.kernel.ROPStoreManager.initialize(
>         at org.apache.openjpa.kernel.BrokerImpl.initialize(
>         at org.apache.openjpa.kernel.BrokerImpl.find(
>         ... 46 more

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


View raw message