openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From egoosen <egoos...@metropolitan.co.za>
Subject Re: Non dirty entity version field update SUPER URGENT!!!
Date Fri, 26 Sep 2008 09:45:56 GMT

Further to my previous post, I came across this in the OpenJPA documentation
which seemed promising:

1.3.1. Detached State Field

When the detached state field is enabled, the OpenJPA enhancer adds an
additional field to the enhanced version of your class. This field of type
Object. OpenJPA uses this field for bookkeeping information, such as the
versioning data needed to detect optimistic concurrency violations when the
object is re-attached.

It is possible to define this detached state field yourself. Declaring this
field in your class metadata prevents the enhancer from adding any extra
fields to the class, and keeps the enhanced class serialization-compatible
with the unenhanced version. The detached state field must not be
persistent. See Section 3.1.3, “Detached State” for details on how to
declare a detached state field. 

Unfortunately, the state field is of type Object (not serializable), so I
can't copy this field to my GWT-friendly DTO.

Since OpenJPA is smart enough to know that no fields have been modified it
shouldn't be much extra code to prevent the version column update. I guess
we'll need to add a patch to the OpenJPA code.

-- 
View this message in context: http://n2.nabble.com/Non-dirty-entity-version-field-update-SUPER-URGENT%21%21%21-tp1120307p1120452.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Mime
View raw message