Sophie

Sophie

distrib > Mandriva > 2007.0 > x86_64 > media > main-release > by-pkgid > a4c98df40e78f6c892308fd6841f950a > files > 681

lib64db4.2-devel-4.2.52-11mdv2007.0.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Wed Dec 03 16:22:10 EST 2003 -->
<TITLE>
DbTxn (Sleepycat Software, Inc. - Berkeley DB Java API)
</TITLE>
<META NAME="keywords" CONTENT="com.sleepycat.db.DbTxn,DbTxn class">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../style.css" TITLE="Style">
</HEAD>
<SCRIPT>
function asd()
{
parent.document.title="DbTxn (Sleepycat Software, Inc. - Berkeley DB Java API)";
}
</SCRIPT>
<BODY BGCOLOR="white" onload="asd();">

<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_top"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/DbTxn.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<b>Berkeley DB</b><br><font size="-1"> version 4.2.52</font></EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../com/sleepycat/db/Dbt.html"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../com/sleepycat/db/DbTxnStat.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="DbTxn.html" TARGET="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;
<SCRIPT>
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
com.sleepycat.db</FONT>
<BR>
Class DbTxn</H2>
<PRE>
<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">java.lang.Object</A>
  |
  +--<B>com.sleepycat.db.DbTxn</B>
</PRE>
<HR>
<DL>
<DT>public class <B>DbTxn</B><DT>extends <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A></DL>

<P>
The DbTxn object is the handle for a transaction.  Methods off the DbTxn handle are used to configure, abort and commit the transaction.  DbTxn handles are provided to <A HREF="../../../com/sleepycat/db/Db.html"><CODE>Db</CODE></A> methods in order to transactionally protect those database operations.</p> <p>DbTxn handles are not free-threaded; transactions handles may be used by multiple threads, but only serially, that is, the application must serialize access to the DbTxn handle.  Once the <A HREF="../../../com/sleepycat/db/DbTxn.html#abort()"><CODE>DbTxn.abort</CODE></A> or <A HREF="../../../com/sleepycat/db/DbTxn.html#commit(int)"><CODE>DbTxn.commit</CODE></A> methods are called, the handle may not be accessed again, regardless of the method's return. In addition, parent transactions may not issue any Berkeley DB operations while they have active child transactions (child transactions that have not yet been committed or aborted) except for <A HREF="../../../com/sleepycat/db/DbEnv.html#txnBegin(com.sleepycat.db.DbTxn, int)"><CODE>DbEnv.txnBegin</CODE></A>, <A HREF="../../../com/sleepycat/db/DbTxn.html#abort()"><CODE>DbTxn.abort</CODE></A> and <A HREF="../../../com/sleepycat/db/DbTxn.html#commit(int)"><CODE>DbTxn.commit</CODE></A>.</p>
<P>

<P>
<HR>

<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->


<!-- =========== FIELD SUMMARY =========== -->


<!-- ======== CONSTRUCTOR SUMMARY ======== -->


<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/sleepycat/db/DbTxn.html#abort()">abort</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The DbTxn.abort method causes an abnormal termination of the transaction.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/sleepycat/db/DbTxn.html#commit(int)">commit</A></B>(int&nbsp;flags)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The DbTxn.commit method ends the transaction.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/sleepycat/db/DbTxn.html#discard(int)">discard</A></B>(int&nbsp;flags)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The DbTxn.discard method frees up all the per-process resources associated with the specified <A HREF="../../../com/sleepycat/db/DbTxn.html"><CODE>DbTxn</CODE></A> handle, neither committing nor aborting the transaction.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/sleepycat/db/DbTxn.html#equals(java.lang.Object)">equals</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A>&nbsp;obj)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/sleepycat/db/DbTxn.html#hashCode()">hashCode</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/sleepycat/db/DbTxn.html#id()">id</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The DbTxn.id method returns the unique transaction id associated with the specified transaction.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/sleepycat/db/DbTxn.html#prepare(byte[])">prepare</A></B>(byte[]&nbsp;gid)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The DbTxn.prepare method initiates the beginning of a two-phase commit.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/sleepycat/db/DbTxn.html#set_timeout(long, int)">set_timeout</A></B>(long&nbsp;timeout,
            int&nbsp;flags)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>Deprecated.</B>&nbsp;<I>As of Berkeley DB 4.2, replaced by <A HREF="../../../com/sleepycat/db/DbTxn.html#setTimeout(long, int)"><CODE>setTimeout(long,int)</CODE></A></I></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/sleepycat/db/DbTxn.html#setTimeout(long, int)">setTimeout</A></B>(long&nbsp;timeout,
           int&nbsp;flags)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The DbTxn.setTimeout method sets timeout values for locks or transactions for the specified transaction.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#getClass()">getClass</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#notify()">notify</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#toString()">toString</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#wait()">wait</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#wait(long)">wait</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#wait(long, int)">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ FIELD DETAIL =========== -->


<!-- ========= CONSTRUCTOR DETAIL ======== -->


<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="abort()"><!-- --></A><H3>
abort</H3>
<PRE>
public void <B>abort</B>()
           throws <A HREF="../../../com/sleepycat/db/DbException.html">DbException</A></PRE>
<DL>
<DD>The DbTxn.abort method causes an abnormal termination of the transaction. The log is played backward, and any necessary undo operations are done through the <b>tx_recover</b> function specified to <A HREF="../../../com/sleepycat/db/DbEnv.html#setAppDispatch(com.sleepycat.db.DbAppDispatch)"><CODE>DbEnv.setAppDispatch</CODE></A>.  Before DbTxn.abort returns, any locks held by the transaction will have been released.</p> <p>In the case of nested transactions, aborting a parent transaction causes all children (unresolved or not) of the parent transaction to be aborted.</p> <p>All cursors opened within the transaction must be closed before the transaction is aborted.</p> <p>After DbTxn.abort has been called, regardless of its return, the <A HREF="../../../com/sleepycat/db/DbTxn.html"><CODE>DbTxn</CODE></A> handle may not be accessed again.</p>
<P>
<DD><DL>

<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../com/sleepycat/db/DbException.html">DbException</A></CODE> - Signals that an exception of some sort has occurred.</DL>
</DD>
</DL>
<HR>

<A NAME="commit(int)"><!-- --></A><H3>
commit</H3>
<PRE>
public void <B>commit</B>(int&nbsp;flags)
            throws <A HREF="../../../com/sleepycat/db/DbException.html">DbException</A></PRE>
<DL>
<DD>The DbTxn.commit method ends the transaction.</p> <p>In the case of nested transactions, if the transaction is a parent transaction, committing the parent transaction causes all unresolved children of the parent to be committed.  In the case of nested transactions, if the transaction is a child transaction, its locks are not released, but are acquired by its parent.  Although the commit of the child transaction will succeed, the actual resolution of the child transaction is postponed until the parent transaction is committed or aborted; that is, if its parent transaction commits, it will be committed; and if its parent transaction aborts, it will be aborted.</p> <p>All cursors opened within the transaction must be closed before the transaction is committed.</p> <p>After DbTxn.commit has been called, regardless of its return, the <A HREF="../../../com/sleepycat/db/DbTxn.html"><CODE>DbTxn</CODE></A> handle may not be accessed again.  If DbTxn.commit encounters an error, the transaction and all child transactions of the transaction are aborted.</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>flags</CODE> - must be set to 0 or one of the following values: <ul><li><A HREF="../../../com/sleepycat/db/Db.html#DB_TXN_NOSYNC"><CODE>Db.DB_TXN_NOSYNC</CODE></A><p>Do not synchronously flush the log.  This means the transaction will exhibit the ACI (atomicity, consistency, and isolation) properties, but not D (durability); that is, database integrity will be maintained, but it is possible that this transaction may be undone during recovery. <p>This behavior may be set for a Berkeley DB environment using the <A HREF="../../../com/sleepycat/db/DbEnv.html#setFlags(int, boolean)"><CODE>DbEnv.setFlags</CODE></A> method or for a single transaction using the <A HREF="../../../com/sleepycat/db/DbEnv.html#txnBegin(com.sleepycat.db.DbTxn, int)"><CODE>DbEnv.txnBegin</CODE></A> method.  Any value specified to this method overrides both of those settings.</p> </li></ul><ul><li><A HREF="../../../com/sleepycat/db/Db.html#DB_TXN_SYNC"><CODE>Db.DB_TXN_SYNC</CODE></A><p>Synchronously flush the log.  This means the transaction will exhibit all of the ACID (atomicity, consistency, isolation, and durability) properties. <p>This behavior is the default for Berkeley DB environments unless the <A HREF="../../../com/sleepycat/db/Db.html#DB_TXN_NOSYNC"><CODE><code>Db.DB_TXN_NOSYNC</code></CODE></A> flag was specified to the <A HREF="../../../com/sleepycat/db/DbEnv.html#setFlags(int, boolean)"><CODE>DbEnv.setFlags</CODE></A> method.  This behavior may also be set for a single transaction using the <A HREF="../../../com/sleepycat/db/DbEnv.html#txnBegin(com.sleepycat.db.DbTxn, int)"><CODE>DbEnv.txnBegin</CODE></A> method.  Any value specified to this method overrides both of those settings.</p> </li></ul>
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../com/sleepycat/db/DbException.html">DbException</A></CODE> - Signals that an exception of some sort has occurred.</DL>
</DD>
</DL>
<HR>

<A NAME="discard(int)"><!-- --></A><H3>
discard</H3>
<PRE>
public void <B>discard</B>(int&nbsp;flags)
             throws <A HREF="../../../com/sleepycat/db/DbException.html">DbException</A></PRE>
<DL>
<DD>The DbTxn.discard method frees up all the per-process resources associated with the specified <A HREF="../../../com/sleepycat/db/DbTxn.html"><CODE>DbTxn</CODE></A> handle, neither committing nor aborting the transaction.  This call may be used only after calls to <A HREF="../../../com/sleepycat/db/DbEnv.html#txnRecover(int, int)"><CODE>DbEnv.txnRecover</CODE></A> when there are multiple global transaction managers recovering transactions in a single Berkeley DB environment.  Any transactions returned by <A HREF="../../../com/sleepycat/db/DbEnv.html#txnRecover(int, int)"><CODE>DbEnv.txnRecover</CODE></A> that are not handled by the current global transaction manager should be discarded using DbTxn.discard.</p> After DbTxn.discard has been called, regardless of its return, the <A HREF="../../../com/sleepycat/db/DbTxn.html"><CODE>DbTxn</CODE></A> handle may not be accessed again.</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>flags</CODE> - currently unused, and must be set to 0.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../com/sleepycat/db/DbException.html">DbException</A></CODE>
<DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - The DbTxn.discard method will fail and throw a IllegalArgumentException exception if the transaction handle does not refer to a transaction that was recovered into a prepared but not yet completed state; or if an invalid flag value or parameter was specified.</DL>
</DD>
</DL>
<HR>

<A NAME="equals(java.lang.Object)"><!-- --></A><H3>
equals</H3>
<PRE>
public boolean <B>equals</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A>&nbsp;obj)</PRE>
<DL>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#equals(java.lang.Object)">equals</A></CODE> in class <CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A></CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="hashCode()"><!-- --></A><H3>
hashCode</H3>
<PRE>
public int <B>hashCode</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#hashCode()">hashCode</A></CODE> in class <CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A></CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="id()"><!-- --></A><H3>
id</H3>
<PRE>
public int <B>id</B>()
       throws <A HREF="../../../com/sleepycat/db/DbException.html">DbException</A></PRE>
<DL>
<DD>The DbTxn.id method returns the unique transaction id associated with the specified transaction.  Locking calls made on behalf of this transaction should use the value returned from DbTxn.id as the locker parameter to the <A HREF="../../../com/sleepycat/db/DbEnv.html#lockGet(int, int, com.sleepycat.db.Dbt, int)"><CODE>DbEnv.lockGet</CODE></A> or <A HREF="../../../com/sleepycat/db/DbEnv.html#lockVector(int, int, com.sleepycat.db.DbLockRequest[], int, int)"><CODE>DbEnv.lockVector</CODE></A> calls.</p>
<P>
<DD><DL>

<DT><B>Returns:</B><DD>The DbTxn.id method returns the unique transaction id associated with the specified transaction.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../com/sleepycat/db/DbException.html">DbException</A></CODE> - Signals that an exception of some sort has occurred.</DL>
</DD>
</DL>
<HR>

<A NAME="prepare(byte[])"><!-- --></A><H3>
prepare</H3>
<PRE>
public void <B>prepare</B>(byte[]&nbsp;gid)
             throws <A HREF="../../../com/sleepycat/db/DbException.html">DbException</A></PRE>
<DL>
<DD>The DbTxn.prepare method initiates the beginning of a two-phase commit.</p> <p>In a distributed transaction environment, Berkeley DB can be used as a local transaction manager.  In this case, the distributed transaction manager must send <i>prepare</i> messages to each local manager.  The local manager must then issue a DbTxn.prepare and await its successful return before responding to the distributed transaction manager.  Only after the distributed transaction manager receives successful responses from all of its <i>prepare</i> messages should it issue any <i>commit</i> messages.</p> <p>In the case of nested transactions, preparing the parent causes all unresolved children of the parent transaction to be committed. Child transactions should never be explicitly prepared. Their fate will be resolved along with their parent's during global recovery.</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>gid</CODE> - specifies the global transaction ID by which this transaction will be known.  This global transaction ID will be returned in calls to <A HREF="../../../com/sleepycat/db/DbEnv.html#txnRecover(int, int)"><CODE>DbEnv.txnRecover</CODE></A>, telling the application which global transactions must be resolved. <ul><li><A HREF="../../../com/sleepycat/db/Db.html#DB_XIDDATASIZE"><CODE>Db.DB_XIDDATASIZE</CODE></A><p>must be sized at least <code>Db.DB_XIDDATASIZE</code> (currently 128) bytes; only the first <code>Db.DB_XIDDATASIZE</code> bytes are used. </li></ul>
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../com/sleepycat/db/DbException.html">DbException</A></CODE> - Signals that an exception of some sort has occurred.</DL>
</DD>
</DL>
<HR>

<A NAME="set_timeout(long, int)"><!-- --></A><H3>
set_timeout</H3>
<PRE>
public void <B>set_timeout</B>(long&nbsp;timeout,
                        int&nbsp;flags)
                 throws <A HREF="../../../com/sleepycat/db/DbException.html">DbException</A></PRE>
<DL>
<DD><B>Deprecated.</B>&nbsp;<I>As of Berkeley DB 4.2, replaced by <A HREF="../../../com/sleepycat/db/DbTxn.html#setTimeout(long, int)"><CODE>setTimeout(long,int)</CODE></A></I>
<P>
<DD><DL>

<DD><CODE><A HREF="../../../com/sleepycat/db/DbException.html">DbException</A></CODE></DL>
</DD>
</DL>
<HR>

<A NAME="setTimeout(long, int)"><!-- --></A><H3>
setTimeout</H3>
<PRE>
public void <B>setTimeout</B>(long&nbsp;timeout,
                       int&nbsp;flags)
                throws <A HREF="../../../com/sleepycat/db/DbException.html">DbException</A></PRE>
<DL>
<DD>The DbTxn.setTimeout method sets timeout values for locks or transactions for the specified transaction.</p> <p>Timeouts are checked whenever a thread of control blocks on a lock or when deadlock detection is performed.  (In the case of Db.DB_SET_LOCK_TIMEOUT, the lock is one requested explicitly through the Lock subsystem interfaces.  In the case of Db.DB_SET_TXN_TIMEOUT, the lock is one requested on behalf of a transaction.  In either case, it may be a lock requested by the database access methods underlying the application.)  As timeouts are only checked when the lock request first blocks or when deadlock detection is performed, the accuracy of the timeout depends on how often deadlock detection is performed.</p> <p>Timeout values may be specified for the database environment as a whole. See <A HREF="../../../com/sleepycat/db/DbEnv.html#setTimeout(long, int)"><CODE>DbEnv.setTimeout</CODE></A> and for more information.</p> <p>The DbTxn.setTimeout method configures operations performed on the underlying transaction, not only operations performed using the specified <A HREF="../../../com/sleepycat/db/DbTxn.html"><CODE>DbTxn</CODE></A> handle.</p> <p>The DbTxn.setTimeout method may be called at any time during the life of the application.</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>flags</CODE> - must be set to one of the following values: <ul><li><A HREF="../../../com/sleepycat/db/Db.html#DB_SET_LOCK_TIMEOUT"><CODE>Db.DB_SET_LOCK_TIMEOUT</CODE></A><p>Set the timeout value for locks in this transaction. </li></ul><ul><li><A HREF="../../../com/sleepycat/db/Db.html#DB_SET_TXN_TIMEOUT"><CODE>Db.DB_SET_TXN_TIMEOUT</CODE></A><p>Set the timeout value for this transaction. </li></ul><DD><CODE>timeout</CODE> - specified as an unsigned 32-bit number of microseconds, limiting the maximum timeout to roughly 71 minutes.  A value of 0 disables timeouts for the transaction.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../com/sleepycat/db/DbException.html">DbException</A></CODE>
<DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - The DbTxn.setTimeout method will fail and throw a IllegalArgumentException exception if an invalid flag value or parameter was specified.</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>

<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/DbTxn.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<b>Berkeley DB</b><br><font size="-1"> version 4.2.52</font></EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../com/sleepycat/db/Dbt.html"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../com/sleepycat/db/DbTxnStat.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="DbTxn.html" TARGET="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;
<SCRIPT>
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->

<HR>
<font size=1><a href="../../../../sleepycat/legal.html">Copyright (c) 1996-2003</a> <a href="http://www.sleepycat.com">Sleepycat Software, Inc.</a> - All rights reserved.</font>
</BODY>
</HTML>