|  | <html><head> | 
|  | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> | 
|  | <title>7.  Transaction Events</title><base href="display"><link rel="stylesheet" type="text/css" href="css/docbook.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="manual.html" title="Apache OpenJPA 3.0 User's Guide"><link rel="up" href="ref_guide_runtime.html" title="Chapter 9.  Runtime Extensions"><link rel="prev" href="ref_guide_sequence.html" title="6.  Generators"><link rel="next" href="ref_guide_enterprise_abstractstore.html" title="8.  Non-Relational Stores"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">7.  | 
|  | Transaction Events | 
|  | </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ref_guide_sequence.html">Prev</a> </td><th width="60%" align="center">Chapter 9.  | 
|  | Runtime Extensions | 
|  | </th><td width="20%" align="right"> <a accesskey="n" href="ref_guide_enterprise_abstractstore.html">Next</a></td></tr></table><hr></div><div class="section" id="ref_guide_runtime_pm_event"><div class="titlepage"><div><div><h2 class="title" style="clear: both">7.  | 
|  | Transaction Events | 
|  | </h2></div></div></div> | 
|  |  | 
|  | <a class="indexterm" name="d5e15965"></a> | 
|  | <p> | 
|  | The OpenJPA runtime supports broadcasting transaction-related events. By | 
|  | registering one or more | 
|  | <a class="ulink" href="../../apidocs/org/apache/openjpa/event/TransactionListener.html" target="_top"> | 
|  | <code class="classname">org.apache.openjpa.event.TransactionListener</code></a> 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. | 
|  | </p> | 
|  | <pre class="programlisting"> | 
|  | public void addTransactionListener(Object listener); | 
|  | public void removeTransactionListener(Object listener); | 
|  | </pre> | 
|  | <p> | 
|  | These <code class="classname">OpenJPAEntityManagerSPI</code> 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. | 
|  | </p> | 
|  | <p> | 
|  | For details on the transaction framework, see the <code class="literal"> | 
|  | org.apache.openjpa.event</code> package | 
|  | <a class="ulink" href="../../apidocs/org/apache/openjpa/event/package-summary.html" target="_top">Javadoc</a>. | 
|  | Also see <a class="xref" href="ref_guide_event.html" title="2.  Remote Event Notification Framework">Section 2, “ | 
|  | Remote Event Notification Framework | 
|  | ”</a> for a description of OpenJPA's | 
|  | remote event support. | 
|  | </p> | 
|  | </div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ref_guide_sequence.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref_guide_runtime.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ref_guide_enterprise_abstractstore.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">6.  | 
|  | Generators | 
|  |  </td><td width="20%" align="center"><a accesskey="h" href="manual.html">Home</a></td><td width="40%" align="right" valign="top"> 8.  | 
|  | Non-Relational Stores | 
|  | </td></tr></table></div></body></html> |