the pcStateManager is null after deserialisation as far as I've seen. I'll give it another debug run tomorrow to be 100% sure about that.
LieGrue, strub --- On Tue, 1/18/11, Michael Dick <[email protected]> wrote: > From: Michael Dick <[email protected]> > Subject: Re: way to restore the DetachedStateManager on deserialisation? > To: [email protected] > Date: Tuesday, January 18, 2011, 4:26 PM > Hi, > > DetachedStateField=true should do the trick. When you use > that configuration > option does the statemanager get serialized and then forget > about _loaded? > Or is it never serialized at all? > > -mike > > On Tue, Jan 18, 2011 at 4:33 AM, Mark Struberg <[email protected]> > wrote: > > > Hi! > > > > Currently detached entities behave completely > different if they are 'just' > > detached or if they got serialised/deserialised. This > is almost solely due > > to _pcStateManager == null after the serialisation. > > > > After serialisation we basically miss _dirty and > _loaded information in our > > entities, which has a few very bad side effects. > > > > The one which currently annoy me most is that setting > a field to null > > doesn't get stored to the database. This is caused > because we don't have the > > _loaded information anymore and thus cannot know if > the field is null > > because it never got loaded or if it got set to null > manually. > > > > Now my question: is it possible to restore the > DetachedStateManager on > > deserialisation somehow? There is already an option > for if: > > > > <property name="openjpa.DetachState" > > value="loaded(DetachedStateField=true)"/> > > > > But either I'm making something wrong, or it just > doesn't work. Any hints > > on that? > > > > Btw: I'm mainly working with compiletime enhanced > classes, but I guess the > > basic problem remains the same in any enhancement > case. > > > > txs and LieGrue, > > strub > > > > > > > > > > >
