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 20:32:33 GMT
OK I can see where it is blowing up and it doesn't make any sense to me. The
code below gets called for every attached entity in the main entity, with
all the other attached entities "sm" is non-null (I put an arrow below to
show you where I am referring to), but in the case of the "supplier" entity
you saw in my stack trace, sm is returning null and hence throwing the
InvalidStateException. Since all my entities are attached using the same
piece of code, this doesn't make any sense. I can confirm that all the
entities have an id and are non-null because I checked it in my watch
window. So somewhere in the _broker.getStateManager() the wheels are falling
off.  I'll dig deeper.


	private void preFlushPC(ValueMetaData vmd, Object obj, boolean
			OpCallbacks call) {
		if (obj == null)
		OpenJPAStateManager sm;
		if (vmd.getCascadePersist() == 0) {
			if (!_broker.isDetachedNew() &&
-->			sm = _broker.getStateManager(obj);
			if (sm == null || !sm.isPersistent())
				throw (new InvalidStateException(_loc.get(

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

On Wed, Sep 16, 2009 at 3:31 PM, C N Davies <> wrote:

> 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
> there.
> Hmm, any way you can do it with build-time enhancement? Pretty please?

> (JPA orm.xml). You cannot attach a reference to a new object without
> > cascading.
Maybe I misread that. I'm reading it as the main object is new and the
attachment is an existing entity, not the attached is new...

Daryl Stultz
6 Degrees Software and Consulting, Inc.

View raw message