1<!--$Id: faq.so,v 10.22 2006/11/13 18:05:06 bostic Exp $-->
2<!--Copyright (c) 1997,2008 Oracle.  All rights reserved.-->
3<!--See the file LICENSE for redistribution information.-->
4<html>
5<head>
6<title>Berkeley DB Reference Guide: XA: Frequently Asked Questions</title>
7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
9</head>
10<body bgcolor=white>
11<a name="2"><!--meow--></a><a name="3"><!--meow--></a>
12<table width="100%"><tr valign=top>
13<td><b><dl><dt>Berkeley DB Reference Guide:<dd>Distributed Transactions</dl></b></td>
14<td align=right><a href="../xa/xa_config.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../apprec/intro.html"><img src="../../images/next.gif" alt="Next"></a>
15</td></tr></table>
16<p align=center><b>XA: Frequently Asked Questions</b></p>
17<ol>
18<p><li><b>Is it possible to mix XA and non-XA transactions?</b>
19<p>Yes.  It is also possible for XA and non-XA transactions to coexist in
20the same Berkeley DB environment.  To do this, specify the same environment
21to the non-XA <a href="../../api_c/env_open.html">DB_ENV-&gt;open</a> calls as was specified in the Tuxedo
22configuration file.</p>
23<hr size=1 noshade>
24<p><li><b>Does converting an application to run within XA change any of
25the already existing C/C++ API calls it does?</b>
26<p>When converting an application to run under XA, the application's Berkeley DB
27calls are unchanged, with three exceptions:</p>
28<ol>
29<p><li>The application must specify the <a href="../../api_c/db_class.html#DB_XA_CREATE">DB_XA_CREATE</a> flag to
30the <a href="../../api_c/db_class.html">db_create</a> function.
31<p><li>Unless the application is performing an operation for a non-XA
32transaction, the application should never explicitly call
33<a href="../../api_c/txn_commit.html">DB_TXN-&gt;commit</a>, <a href="../../api_c/txn_abort.html">DB_TXN-&gt;abort</a> or <a href="../../api_c/txn_begin.html">DB_ENV-&gt;txn_begin</a>, and those
34calls should be replaced by calls into the Tuxedo transaction manager.
35<p><li>Unless the application is performing an operation for a non-XA
36transaction, the application should specify a transaction argument of NULL
37to Berkeley DB methods taking transaction arguments (for example, <a href="../../api_c/db_put.html">DB-&gt;put</a>
38or <a href="../../api_c/db_cursor.html">DB-&gt;cursor</a>).
39</ol>
40<p>Otherwise, the application should be unchanged.</p>
41<hr size=1 noshade>
42<p><li><b>How does Berkeley DB recovery interact with recovery by the Tuxedo
43transaction manager?</b>
44<p>Recovery is completed in two steps.  First, each resource manager should
45recover its environment(s).  This can be done via a program that calls
46<a href="../../api_c/env_open.html">DB_ENV-&gt;open</a> or by calling the <a href="../../utility/db_recover.html">db_recover</a> utility.  If
47using the <a href="../../utility/db_recover.html">db_recover</a> utility, then the <b>-e</b> option
48should be specified so that the regions that are recovered persist after
49the utility exits.  Any transactions that were prepared, but neither
50completed nor aborted, are restored to their prepared state so that they
51may be aborted or committed via the Tuxedo recovery mechanisms.  After
52each resource manager has recovered, then Tuxedo recovery may begin.
53Tuxedo will interact with each resource manager via the __db_xa_recover
54function which returns the list of prepared, but not yet completed
55transactions. It should issue a commit or abort for each one, and only
56after having completed each transaction will normal processing resume.</p>
57<p>Finally, standard log file archival and catastrophic recovery procedures
58should occur independently of XA operation.</p>
59</ol>
60<table width="100%"><tr><td><br></td><td align=right><a href="../xa/xa_config.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../apprec/intro.html"><img src="../../images/next.gif" alt="Next"></a>
61</td></tr></table>
62<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
63</body>
64</html>
65