openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jody Grassel <>
Subject Re: Issue Merging Object w/Null Timestamp when Detached State Field Disabled
Date Mon, 24 Aug 2009 19:40:01 GMT
Good afternoon, Jason

I was wondering if you could share a little more detail about the entity
class itself, is the date field eager or lazy loaded by default?  I
tried to reproduce the problem you're encountering without much success.

Thinking about what was described in the previous notes, I have to
wonder: is your date field eager or lazy loaded?  When you get a managed
entity object back from OpenJPA, it embeds a lot of internal metadata,
so it can track changes (this metadata is serialized along with the
normal model data).  One bit of metadata, I would expect, is whether a
field was faulted in during the time the entity was managed by a
persistence context.  If a lazy loaded field was not faulted in before
the entity became detached, then it was probably null to begin with;
which means on merge, the persistence manager will have to assume that
the null means there was no change.  It must do this to fulfill the JPA
1.0 contract section

"The persistence provider must not merge fields marked LAZY that have
not been fetched: it must ignore such fields when merging."

View raw message