7.  Transaction Events

The OpenJPA runtime supports broadcasting transaction-related events. By registering one or more org.apache.openjpa.event.TransactionListener s, you can receive notifications when transactions begin, flush, rollback, commit, and more. Where appropriate, event notifications include the set of persistence-capable objects participating in the transaction.

public void addTransactionListener(Object listener);
public void removeTransactionListener(Object listener);

These OpenJPAEntityManagerSPI methods allow you to add and remove listeners. These methods are outside the bounds of the published OpenJPA APIs, and are subject to change in the future.

For details on the transaction framework, see the org.apache.openjpa.event package Javadoc. Also see Section 2, “ Remote Event Notification Framework ” for a description of OpenJPA's remote event support.