On Wed, Jul 8, 2009 at 12:51 PM, Kevin Sutter <[email protected]> wrote:

> Detecting null fields during re-attachment is tricky.  How do you know if
> the field was null'd out explicitly, or if it was never filled in in the
> first place?


That reminds me, I set this:
<property name="openjpa.DetachState" value="loaded(AccessUnloaded=false)"/>

so I don't get null when accessing an unloaded field (it throws exception).

Also, while I don't believe this is related to Chris's situation (since he
stated setting the field to some other non-null value works) I spent an
awful lot of time trying to figure out why a changed property was not being
updated in the DB: if you set a property while an entity is attached to an
em, then you detach from the em, reattach to another em, the merged changes
will not be saved. Detach from first em before setting properties.

-- 
Daryl Stultz
_____________________________________
6 Degrees Software and Consulting, Inc.
http://www.6degrees.com
mailto:[email protected]

Reply via email to