openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "C N Davies" <>
Subject RE: SingleFieldManager crash
Date Wed, 16 Sep 2009 19:31:45 GMT

-----Original Message-----
From: Daryl Stultz [] 
Sent: Thursday, 17 September 2009 3:08 AM
Subject: Re: SingleFieldManager crash

On Wed, Sep 16, 2009 at 2:48 PM, C N Davies <> wrote:

> The main object is new, but the attached entities are not new, the members
> are populated by retrieving existing entities use em.find.
> That is similar to my case, though usually the existing entities are from
query. I'm wondering why there is no primary key after the hash for
Supplier, I always get it.

Not sure about this one, I don't usually see the primary key after the hash,
I'm using the runtime subclassing enhancement so maybe there is a difference

> If I set cascade type to PERSIST I get a different error but basically
> complaining about the same thing:
> What about CascadeType.ALL?

Same issue.

> (JPA orm.xml). You cannot attach a reference to a new object without
> cascading.

>I don't understand this statement at all and contend it's not true. I
>totally do that all the time. That's why I'm so perplexed. I can even do

>A a = new A();
>B b = new B();

>and it works (provided B with ID of 12 exists in the database).

Yes I agree, sometimes it works and sometimes it doesn't. I just happen to
have one particular case whereby it always fails. I'm trying to debug the
SingleFieldManager now to see if I can see what is happening.

In the past I had this behaviour if I was using queries retrieve the
attached entities because I was using a second instance of the entity
manager. Once I fixed that code the issue went away, however I still have
this class that will always fail. 


View raw message