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 <strub...@yahoo.de> 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 > > > > >