How to record all the changes made in a transaction?


WeiMing.Tang@...
 

We would like  to do data trail with DN.  That is , for every transaction, we want to record all the changes made in the transaction and log them in log file.  We find that DN has interface org.datanucleus.TransactionEventListener to listen to transaction event. But how can we register the listener to a transaction and how to get all changes in the transaction? Thanks for any answering.


Andy
 
Edited

TransactionEventListener allows you to know when a transaction begins/commits etc. This is a DN properietary extension to JDO, registered using
https://github.com/datanucleus/datanucleus-api-jdo/blob/master/src/main/java/org/datanucleus/api/jdo/JDOPersistenceManager.java#L2394
What has changed is a different question, which you can catch using standard JDO lifecycle listeners / callbacks.