openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "C N Davies" <...@cndavies.com>
Subject RE: Unmanaged Object Problems
Date Tue, 06 Apr 2010 13:34:29 GMT
HI Darryl,

 

By intermittent I mean that I can basically use the same method for linking
my Entities and quite randomly I suddenly I'll make some new entity classes
and I get these kinds of problems.  I suspect you may be correct that the
child entity being in a different em,  I have never been happy with how I
use the em in my applications,  I'll have bit more of a think about it and
see if I can sew what is going on. Thanks for the tip

 

To be honest the whole cascade type system to me has a gaping hole in it, I
don't understand why there is no CascadeType of "Join" where we are simply
telling the JPA engine that we are only creating a join and no need to
update/refresh the child entity each time the main entity is save/merged. 

 

Regards

 

Chris

 

From: Daryl Stultz [mailto:daryl@6degrees.com] 
Sent: Monday, 5 April 2010 10:32 PM
To: users@openjpa.apache.org; cnd@cndavies.com
Subject: Re: Unmanaged Object Problems

 

 

On Sun, Apr 4, 2010 at 12:12 PM, C N Davies <cnd@cndavies.com> 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.
http://www.6degrees.com
mailto:daryl@6degrees.com


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