Disclaimer: there's been a lot of discussion on OPENJPA-453 - I haven't
digested all of it.

The testcase for OPENJPA-453 has a single entity (not EntityManager) being
accessed by two threads simultaneously. Heiko, are you sure the entity
instances are not shared between threads?

The StateManager may be nulled out when the entity is detached or evicted
(based on OPENJPA-453). So the only way you _should_ be able to get into
this case is if the entity is accessed on multiple threads - one thread
detaches / evicts and the other uses it.

Christiaan, I don't think the statemanager will be nulled on refresh() - if
you've seen differently that's good data.

-mike


On Wed, Jul 28, 2010 at 6:09 AM, Christiaan <[email protected]>wrote:

>
> Hi Heiko,
> your situation seems related to this one (also see related jira issue
> http://issues.apache.org/jira/browse/OPENJPA-453):
>
> http://openjpa.208410.n2.nabble.com/NullPointerException-in-pcReplaceField-td2979657.html#a2979657
>
> Although in this scenario the nullpointer relates to the statemanager of
> the
> embedded object. You do have an embedded primary key object, however the
> nullpointer seems to happen in the owning object? I can imagine that
> nullifying the statemanager happens with the refresh() call. My own
> experience is that it happens with the evict() or commit() with
> retainValues
> set to false.
>
> Personally I think this really is a problem related to multithreading in
> the
> internal structures of OpenJPA, since the nullpointer happens in code
> generated by OpenJPA. Accessing the statemanager and at the same time
> nullifying it is something OpenJPA code is aware of, not the application
> programmer.
>
> regards,
> Christiaan
> --
> View this message in context:
> http://openjpa.208410.n2.nabble.com/NullPointerException-in-pcGet-Method-tp5337474p5345501.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>

Reply via email to