blob: 899379dacdc14b9fe0e76f6e37588d0c86ef29f0 [file] [log] [blame]
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>3.&nbsp; XA Transactions</title><link rel="stylesheet" href="css/docbook.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.72.0"><link rel="start" href="manual.html" title="Apache OpenJPA User's Guide"><link rel="up" href="ref_guide_deploy.html" title="Chapter&nbsp;8.&nbsp; Deployment"><link rel="prev" href="ref_guide_enterprise_trans.html" title="2.&nbsp; Integrating with the Transaction Manager"><link rel="next" href="ref_guide_runtime.html" title="Chapter&nbsp;9.&nbsp; Runtime Extensions"></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">3.&nbsp;
XA Transactions
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ref_guide_enterprise_trans.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter&nbsp;8.&nbsp;
Deployment
</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="ref_guide_runtime.html">Next</a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="ref_guide_enterprise_xa"></a>3.&nbsp;
XA Transactions
</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="ref_guide_enterprise_xa.html#ref_guide_enterprise_xa_req">3.1.
Using OpenJPA with XA Transactions
</a></span></dt></dl></div><a class="indexterm" name="d0e28173"></a><a class="indexterm" name="d0e28178"></a><p>
The X/Open Distributed Transaction Processing (X/Open DTP) model, designed by
<a xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.xopen.org" target="_top">Open Group</a> (a vendor consortium),
defines a standard communication architecture that provides the following:
</p><div class="itemizedlist"><ul type="disc"><li><p>
Concurrent execution of applications on shared resources.
</p></li><li><p>
Coordination of transactions across applications.
</p></li><li><p>
Components, interfaces, and protocols that define the architecture and provide
portability of applications.
</p></li><li><p>
Atomicity of transaction systems.
</p></li><li><p>
Single-thread control and sequential function-calling.
</p></li></ul></div><p>
The X/Open DTP XA standard defines the application programming interfaces that a
resource manager uses to communicate with a transaction manager. The XA
interfaces enable resource managers to join transactions, to perform two-phase
commit, and to recover in-doubt transactions following a failure.
</p><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="ref_guide_enterprise_xa_req"></a>3.1.&nbsp;
Using OpenJPA with XA Transactions
</h3></div></div></div><p>
OpenJPA supports XA-compliant transactions when used in a properly configured
managed environment. The following components are required:
</p><div class="itemizedlist"><ul type="disc"><li><p>
A managed environment that provides an XA compliant transaction manager.
Examples of this are application servers such as WebLogic or JBoss.
</p></li><li><p>
Instances of a <code class="classname">javax.sql.XADataSource</code> for each of the
<code class="classname">DataSource</code>s that OpenJPA will use.
</p></li></ul></div><p>
Given these components, setting up OpenJPA to participate in distributed
transactions is a simple two-step process:
</p><div class="orderedlist"><ol type="1"><li><p>
Integrate OpenJPA with your application server's transaction manager, as
detailed in <a href="ref_guide_enterprise_trans.html" title="2.&nbsp; Integrating with the Transaction Manager">Section&nbsp;2, &#8220;
Integrating with the Transaction Manager
&#8221;</a> above.
</p></li><li><p>
Point OpenJPA at an enlisted <code class="classname">XADataSource</code>, and configure
a second non-enlisted data source. See
<a href="ref_guide_dbsetup_thirdparty.html#ref_guide_dbsetup_thirdparty_enlist" title="2.1.&nbsp; Managed and XA DataSources">Section&nbsp;2.1, &#8220;
Managed and XA DataSources
&#8221;</a>.
</p></li></ol></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ref_guide_enterprise_trans.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="ref_guide_deploy.html">Up</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="ref_guide_runtime.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">2.&nbsp;
Integrating with the Transaction Manager
&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="manual.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;Chapter&nbsp;9.&nbsp;
Runtime Extensions
</td></tr></table></div></body></html>