I wasn't able to recreate this on trunk. Maybe this is specific to the 1.2.x branch? ...would it be possible for you to try this out on 2.0.x or trunk?
Thanks, Rick On Tue, Sep 21, 2010 at 5:35 PM, Kelvin Law <[email protected]> wrote: > Hi, > > I have a MappedSuperClass which has a @PreUpdate annotation on a method. > > The @PreUpdate method only has one line like below: > > this.updateTime = new Date(); > > (and updateTime is actually mapped to a column) > > I noticed that there are some unnecessary sql being generated when I tried > to update the entities... > > For example: Update SOME_TABLE set UPDATE_TIME = <some_date> where ID = ? > and VERSION = ? > > And because of this sql statement, OpenJPA will throw JpaOptimisticLocking > (because it cannot update the entity with the specific version). > > I have tried to comment out the @PreUpdate method then everything works > fine. (except that I cannot have the last modified time of the entity). > > So my question is, is this a bug? and is there any work around for that? > > I am using OpenJpa 1.2.2 > > Thanks > Kelvin > >
