openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daryl Stultz <>
Subject Re: SingleFieldManager crash
Date Fri, 18 Sep 2009 17:38:23 GMT
On Fri, Sep 18, 2009 at 10:51 AM, Daryl Stultz <> wrote:

> On Fri, Sep 18, 2009 at 10:36 AM, C N Davies <> wrote:
>> Next it gets the persistence context. This is where I have a suspicion the
>> issue is occurring
> Can you do me a favor and keep your code such that the object is detached
> and causing the failure and tell me how  _broker.isDetachedNew() and
> _broker.isDetached(obj) evaluate? I realize the second may be tricky if the
> first returns false. This is the one thing I can't do since I can't repeat
> it.
> After some code sniffing, I've determined that
EntityManagerFactoryImpl.createEntityManager(...) is
calling broker.setDetachedNew(false) and this is the only
place broker.setDetachedNew is called. So _broker.isDetachedNew() should
always return false. The default for BrokerImpl._detachedNew is true so

_broker.isDetached(obj) is not returning true when I think it should.
I'm somehow getting an EM that was not created by
This seems rather unlikely.

So I'm thinking my problem is with _broker.isDetached(obj). I can reproduce
the crash by persisting a new object with a field set to a new object. The
traceback is the same as my production code except the rendering of the
FailedObject is different. My production crash includes the ID of the
FailedObject which indicates it is not new. If I set the ID of my new field
member to an existing record, the test passes.

I guess I need to figure out why _broker.isDetached(obj) thinks my object is
completely new.

Daryl Stultz
6 Degrees Software and Consulting, Inc.

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