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