How to identify fields that are made dirty during an InstanceCallback from within a listener?
ebenzacar@...
Hi Andy, I'm running into a bit of a catch-22 solution here and would love some ideas if you have something. Thanks, Eric |
|
The JDO spec (12.15) explicitly insists that InstanceLifecycleListener methods are called BEFORE InstanceCallbacks, so we can't just change the code to calls to the opposite order, hence using LifecycleListeners for this will always miss anything the user does subsequently (in jdoPreStore).
You could look at adding an extra (DN-specific) listener giving you the explicit info you require, for classes that you want to do auditing on. e.g AuditPersistListener, and then update JDOCallbackHandler to call all AuditPersistListener when all other listeners/callbacks have been called, i.e https://github.com/datanucleus/datanucleus-api-jdo/blob/master/src/main/java/org/datanucleus/api/jdo/JDOCallbackHandler.java#L159 Means a vendor extension so dependent on DN code, but then your solution will be either way. |
|