openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daryl Stultz <>
Subject Re: Unmanaged Object Problems
Date Mon, 05 Apr 2010 20:28:15 GMT
On Mon, Apr 5, 2010 at 4:05 PM, Rick Curtis <> wrote:

> Daryl I'm not entirely sure I follow your last email. My understanding of
> the problem is that we are trying to merge a detached entity that has a
> relationship to an entity which is in a different persistence context.

I don't think I have a good enough understanding of JPA to explain what I
mean. Maybe something like this:

em = getEmFromFactory();
EntityB b = getBFromQuery(em);
EntityA a = new EntityA();

If two threads enter this code overlapping by a few millis, could "b" fail
due to it being managed by the other thread's em? I figure if the problem
with my code resulted in an em being left open and this error being thrown,
then there might be a race condition present even after fixing the problem
in my code, just with a smaller window.

Daryl Stultz
6 Degrees Software and Consulting, Inc.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message