openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Curtis <>
Subject Re: Unmanaged Object Problems
Date Mon, 05 Apr 2010 18:45:11 GMT
I think Daryl hit it spot on. I was able to reproduce the exception from the
previous email and I believe that OpenJPA should be throwing an exception as
pasted below, rather then the one that you are seeing.

Caused by: <openjpa-2.1.0-SNAPSHOT-r422266:930721M nonfatal user error>
org.apache.openjpa.persistence.ArgumentException: The given instance
"cache.Entity-106351" is not managed by this context.
FailedObject: cache.Entity-106351

I'll open a JIRA in the coming days to fix this problem so we throw a more
meaningful message.

On Mon, Apr 5, 2010 at 7:31 AM, Daryl Stultz <> wrote:

> On Sun, Apr 4, 2010 at 12:12 PM, C N Davies <> wrote:
> > This is a problem that continues to haunt me intermittently since I first
> > started using OpenJPA and cannot understand why it comes up from time to
> > time for no apparent reason.
> >
> Hi Chris, when you say it's "intermittent" do you mean it's not
> reproducible? If you recall, I ran into the same crash from time to time. I
> was able to reproduce the stack trace with a unit test but was never sure
> if
> my live app was failing for the same reason. My unit test would try to
> merge
> an object that had a reference to an object that was attached to a
> *different* em. So the error message says it's unmanaged but it's actually
> managed by another em. I found a gaping hole in my em management routine
> that was leaving em's open under a certain race condition. It's a plausible
> scenario that could bring my app and unit test together. So you might study
> your app and see if it's possible the failedObject could be attached to a
> different em.
> --
> Daryl Stultz
> _____________________________________
> 6 Degrees Software and Consulting, Inc.

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