views:

203

answers:

1

I have implemented a DescriptorEventAdapter for JPA (eclipselink). It performs simple timestamp operations. The preUpdate method is being called, however it is being called too often. It gets called and updates the timestamp, even on find/select operations.

The issue I'm running into appears to occur in a different JPA framework also, http://markmail.org/message/nank44rgp4xi2ita#query:JPA%20preupdate%20being%20called%20after%20find+page:1+mid:xssqpg7hm4mesfl5+state:results.

I have attempted to:

  • check the ChangeSet on the DescriptorEvent, this is always null
  • check the code on the DescriptorEvent, this is always 6

I have not been able to find any other flag or attribute that says "this object really was updated".

How do I get preUpdate to act only when a record really was updated and not merely selected?

A: 

http://wiki.eclipse.org/Configuring_a_Descriptor_(ELUG)#Table_115-27

The preUpdate is called all the time, apparently. aboutToUpdate is the better method to call to trigger when an update needs to be done.

Freiheit