openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "C N Davies" <...@cndavies.com>
Subject RE: SingleFieldManager crash
Date Fri, 18 Sep 2009 14:16:17 GMT
I found that my issue relates to the fact that my entity is detached because
my factory was being replaced by some of my buggy code. When it gets into
the broker to assign to sm the wheels are falling off there. 

Might be different ... but gonna hunt this devil down anyway!

Chris

-----Original Message-----
From: Daryl Stultz [mailto:daryl@6degrees.com] 
Sent: Friday, 18 September 2009 10:04 PM
To: users@openjpa.apache.org
Subject: Re: SingleFieldManager crash

On Fri, Sep 18, 2009 at 9:54 AM, C N Davies <cnd@cndavies.com> wrote:

> Daryl I got a bit closer.
>
> Remember the issue is that the line:
>
>                        sm = _broker.getStateManager(obj);
>
> Is returning null.
>
>
I'm not sure that's the problem. I think I've determined that since my
object is detached, sm should be null. When I step through my code (and all
is working fine) it returns on this:

*if* (!_broker.isDetachedNew() && _broker.isDetached(obj))

                *return*; // allow but ignore


So I'm wondering if _broker.isDetachedNew() is returning true or
_broker.isDetached(obj) is returning false. I've asked the dev list what the
meaning of isDetachedNew() is but haven't got an answer. Can you determine
what the these methods return in the failing case?

Maybe your case is different since you are not detaching?


> Do you have the rest of your stack trace from your original posting of
this
> issue?
>

       at
org.apache.openjpa.kernel.SingleFieldManager.preFlushPC(SingleFieldManager.j
ava:754)
       at
org.apache.openjpa.kernel.SingleFieldManager.preFlush(SingleFieldManager.jav
a:594)
       at
org.apache.openjpa.kernel.SingleFieldManager.preFlush(SingleFieldManager.jav
a:562)
       at
org.apache.openjpa.kernel.SingleFieldManager.preFlush(SingleFieldManager.jav
a:478)
       at
org.apache.openjpa.kernel.StateManagerImpl.preFlush(StateManagerImpl.java:28
29)
       at org.apache.openjpa.kernel.PNewState.beforeFlush(PNewState.java:39)
       at
org.apache.openjpa.kernel.StateManagerImpl.beforeFlush(StateManagerImpl.java
:960)
       at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1948)
       at
org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1908)
       at
org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1826)
       at
org.apache.openjpa.kernel.LocalManagedRuntime.commit(LocalManagedRuntime.jav
a:81)
       at org.apache.openjpa.kernel.BrokerImpl.commit(BrokerImpl.java:1350)
       at
org.apache.openjpa.kernel.DelegatingBroker.commit(DelegatingBroker.java:877)
       at
org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.ja
va:512)

-- 
Daryl Stultz
_____________________________________
6 Degrees Software and Consulting, Inc.
http://www.6degrees.com
mailto:daryl@6degrees.com


Mime
View raw message