| 1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| 2 |
|
| 3 |
<HTML> |
| 4 |
<HEAD> |
| 5 |
|
| 6 |
<TITLE> |
| 7 |
Transaction (Oracle - Berkeley DB Java API) |
| 8 |
</TITLE> |
| 9 |
|
| 10 |
<META NAME="date" CONTENT="2013-09-09"> |
| 11 |
|
| 12 |
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../style.css" TITLE="Style"> |
| 13 |
|
| 14 |
<SCRIPT type="text/javascript"> |
| 15 |
function windowTitle() |
| 16 |
{ |
| 17 |
if (location.href.indexOf('is-external=true') == -1) { |
| 18 |
parent.document.title="Transaction (Oracle - Berkeley DB Java API)"; |
| 19 |
} |
| 20 |
} |
| 21 |
</SCRIPT> |
| 22 |
<NOSCRIPT> |
| 23 |
</NOSCRIPT> |
| 24 |
|
| 25 |
</HEAD> |
| 26 |
|
| 27 |
<BODY BGCOLOR="white" onload="windowTitle();"> |
| 28 |
<HR> |
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
<A NAME="navbar_top"></A> |
| 33 |
<A HREF="#skip-navbar_top" title="Skip navigation links"></A> |
| 34 |
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> |
| 35 |
<TR> |
| 36 |
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
| 37 |
<A NAME="navbar_top_firstrow"></A> |
| 38 |
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> |
| 39 |
<TR ALIGN="center" VALIGN="top"> |
| 40 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
| 41 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
| 42 |
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
| 43 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Transaction.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> |
| 44 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
| 45 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
| 46 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
| 47 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
| 48 |
</TR> |
| 49 |
</TABLE> |
| 50 |
</TD> |
| 51 |
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
| 52 |
<b>Berkeley DB</b><br><font size="-1"> version 5.3.28</font></EM> |
| 53 |
</TD> |
| 54 |
</TR> |
| 55 |
|
| 56 |
<TR> |
| 57 |
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| 58 |
<A HREF="../../../com/sleepycat/db/StatsConfig.html" title="class in com.sleepycat.db"><B>PREV CLASS</B></A> |
| 59 |
<A HREF="../../../com/sleepycat/db/TransactionConfig.html" title="class in com.sleepycat.db"><B>NEXT CLASS</B></A></FONT></TD> |
| 60 |
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| 61 |
<A HREF="../../../index.html?com/sleepycat/db/Transaction.html" target="_top"><B>FRAMES</B></A> |
| 62 |
<A HREF="Transaction.html" target="_top"><B>NO FRAMES</B></A> |
| 63 |
<SCRIPT type="text/javascript"> |
| 64 |
<!-- |
| 65 |
if(window==top) { |
| 66 |
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); |
| 67 |
} |
| 68 |
//--> |
| 69 |
</SCRIPT> |
| 70 |
<NOSCRIPT> |
| 71 |
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> |
| 72 |
</NOSCRIPT> |
| 73 |
|
| 74 |
|
| 75 |
</FONT></TD> |
| 76 |
</TR> |
| 77 |
<TR> |
| 78 |
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| 79 |
SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> |
| 80 |
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| 81 |
DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> |
| 82 |
</TR> |
| 83 |
</TABLE> |
| 84 |
<A NAME="skip-navbar_top"></A> |
| 85 |
|
| 86 |
|
| 87 |
<HR> |
| 88 |
|
| 89 |
<H2> |
| 90 |
<FONT SIZE="-1"> |
| 91 |
com.sleepycat.db</FONT> |
| 92 |
<BR> |
| 93 |
Class Transaction</H2> |
| 94 |
<PRE> |
| 95 |
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A> |
| 96 |
<IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.sleepycat.db.Transaction</B> |
| 97 |
</PRE> |
| 98 |
<HR> |
| 99 |
<DL> |
| 100 |
<DT><PRE>public class <B>Transaction</B><DT>extends <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL> |
| 101 |
</PRE> |
| 102 |
|
| 103 |
<P> |
| 104 |
The Transaction object is the handle for a transaction. Methods off the |
| 105 |
transaction handle are used to configure, abort and commit the |
| 106 |
transaction. Transaction handles are provided to other Berkeley DB |
| 107 |
methods in order to transactionally protect those operations. |
| 108 |
<p> |
| 109 |
Transaction handles are not free-threaded; transactions handles may |
| 110 |
be used by multiple threads, but only serially, that is, the application |
| 111 |
must serialize access to the handle. Once the |
| 112 |
<A HREF="../../../com/sleepycat/db/Transaction.html#abort()"><CODE>Transaction.abort</CODE></A>, <A HREF="../../../com/sleepycat/db/Transaction.html#commit()"><CODE>Transaction.commit</CODE></A> or |
| 113 |
<A HREF="../../../com/sleepycat/db/Transaction.html#discard()"><CODE>Transaction.discard</CODE></A> |
| 114 |
methods are called, the handle may |
| 115 |
not be accessed again (except to retrieve the commit token), |
| 116 |
regardless of the success or failure of the method. |
| 117 |
In addition, parent transactions may not issue any Berkeley DB operations |
| 118 |
while they have active child transactions (child transactions that have |
| 119 |
not yet been committed or aborted) except for <A HREF="../../../com/sleepycat/db/Environment.html#beginTransaction(com.sleepycat.db.Transaction, com.sleepycat.db.TransactionConfig)"><CODE>Environment.beginTransaction</CODE></A>, <A HREF="../../../com/sleepycat/db/Transaction.html#abort()"><CODE>Transaction.abort</CODE></A> and <A HREF="../../../com/sleepycat/db/Transaction.html#commit()"><CODE>Transaction.commit</CODE></A>. |
| 120 |
<p> |
| 121 |
To obtain a transaction with default attributes: |
| 122 |
<blockquote><pre> |
| 123 |
Transaction txn = myEnvironment.beginTransaction(null, null); |
| 124 |
</pre></blockquote> |
| 125 |
To customize the attributes of a transaction: |
| 126 |
<blockquote><pre> |
| 127 |
TransactionConfig config = new TransactionConfig(); |
| 128 |
config.setDirtyRead(true); |
| 129 |
Transaction txn = myEnvironment.beginTransaction(null, config); |
| 130 |
</pre></blockquote> |
| 131 |
<P> |
| 132 |
|
| 133 |
<P> |
| 134 |
<HR> |
| 135 |
|
| 136 |
<P> |
| 137 |
|
| 138 |
|
| 139 |
|
| 140 |
<A NAME="method_summary"></A> |
| 141 |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| 142 |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| 143 |
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
| 144 |
<B>Method Summary</B></FONT></TH> |
| 145 |
</TR> |
| 146 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 147 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 148 |
<CODE> void</CODE></FONT></TD> |
| 149 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Transaction.html#abort()">abort</A></B>()</CODE> |
| 150 |
|
| 151 |
<BR> |
| 152 |
Cause an abnormal termination of the transaction.</TD> |
| 153 |
</TR> |
| 154 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 155 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 156 |
<CODE> void</CODE></FONT></TD> |
| 157 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Transaction.html#commit()">commit</A></B>()</CODE> |
| 158 |
|
| 159 |
<BR> |
| 160 |
End the transaction.</TD> |
| 161 |
</TR> |
| 162 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 163 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 164 |
<CODE> void</CODE></FONT></TD> |
| 165 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Transaction.html#commitNoSync()">commitNoSync</A></B>()</CODE> |
| 166 |
|
| 167 |
<BR> |
| 168 |
End the transaction, not committing synchronously.</TD> |
| 169 |
</TR> |
| 170 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 171 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 172 |
<CODE> void</CODE></FONT></TD> |
| 173 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Transaction.html#commitSync()">commitSync</A></B>()</CODE> |
| 174 |
|
| 175 |
<BR> |
| 176 |
End the transaction, committing synchronously.</TD> |
| 177 |
</TR> |
| 178 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 179 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 180 |
<CODE> void</CODE></FONT></TD> |
| 181 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Transaction.html#commitWriteNoSync()">commitWriteNoSync</A></B>()</CODE> |
| 182 |
|
| 183 |
<BR> |
| 184 |
End the transaction, writing but not flushing the log.</TD> |
| 185 |
</TR> |
| 186 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 187 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 188 |
<CODE> void</CODE></FONT></TD> |
| 189 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Transaction.html#discard()">discard</A></B>()</CODE> |
| 190 |
|
| 191 |
<BR> |
| 192 |
Free up all the per-process resources associated with the specified |
| 193 |
<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db"><CODE>Transaction</CODE></A> handle, neither committing nor aborting the |
| 194 |
transaction.</TD> |
| 195 |
</TR> |
| 196 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 197 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 198 |
<CODE> byte[]</CODE></FONT></TD> |
| 199 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Transaction.html#getCommitToken()">getCommitToken</A></B>()</CODE> |
| 200 |
|
| 201 |
<BR> |
| 202 |
Fetch the transaction's commit token.</TD> |
| 203 |
</TR> |
| 204 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 205 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 206 |
<CODE> int</CODE></FONT></TD> |
| 207 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Transaction.html#getId()">getId</A></B>()</CODE> |
| 208 |
|
| 209 |
<BR> |
| 210 |
Return the transaction's unique ID.</TD> |
| 211 |
</TR> |
| 212 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 213 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 214 |
<CODE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD> |
| 215 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Transaction.html#getName()">getName</A></B>()</CODE> |
| 216 |
|
| 217 |
<BR> |
| 218 |
Get the user visible name for the transaction.</TD> |
| 219 |
</TR> |
| 220 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 221 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 222 |
<CODE> int</CODE></FONT></TD> |
| 223 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Transaction.html#getPriority()">getPriority</A></B>()</CODE> |
| 224 |
|
| 225 |
<BR> |
| 226 |
Get the transaction's deadlock priority.</TD> |
| 227 |
</TR> |
| 228 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 229 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 230 |
<CODE> void</CODE></FONT></TD> |
| 231 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Transaction.html#prepare(byte[])">prepare</A></B>(byte[] gid)</CODE> |
| 232 |
|
| 233 |
<BR> |
| 234 |
Initiate the beginning of a two-phase commit.</TD> |
| 235 |
</TR> |
| 236 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 237 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 238 |
<CODE> void</CODE></FONT></TD> |
| 239 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Transaction.html#setLockTimeout(long)">setLockTimeout</A></B>(long timeOut)</CODE> |
| 240 |
|
| 241 |
<BR> |
| 242 |
Configure the lock request timeout value for the transaction.</TD> |
| 243 |
</TR> |
| 244 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 245 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 246 |
<CODE> void</CODE></FONT></TD> |
| 247 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Transaction.html#setName(java.lang.String)">setName</A></B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> name)</CODE> |
| 248 |
|
| 249 |
<BR> |
| 250 |
Set the user visible name for the transaction.</TD> |
| 251 |
</TR> |
| 252 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 253 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 254 |
<CODE> void</CODE></FONT></TD> |
| 255 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Transaction.html#setPriority(int)">setPriority</A></B>(int priority)</CODE> |
| 256 |
|
| 257 |
<BR> |
| 258 |
Set the deadlock priority for this transaction.</TD> |
| 259 |
</TR> |
| 260 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 261 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 262 |
<CODE> void</CODE></FONT></TD> |
| 263 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Transaction.html#setTxnTimeout(long)">setTxnTimeout</A></B>(long timeOut)</CODE> |
| 264 |
|
| 265 |
<BR> |
| 266 |
Configure the timeout value for the transaction lifetime.</TD> |
| 267 |
</TR> |
| 268 |
</TABLE> |
| 269 |
<A NAME="methods_inherited_from_class_java.lang.Object"></A> |
| 270 |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| 271 |
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> |
| 272 |
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH> |
| 273 |
</TR> |
| 274 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 275 |
<TD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD> |
| 276 |
</TR> |
| 277 |
</TABLE> |
| 278 |
|
| 279 |
<P> |
| 280 |
|
| 281 |
|
| 282 |
|
| 283 |
<A NAME="method_detail"></A> |
| 284 |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| 285 |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| 286 |
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
| 287 |
<B>Method Detail</B></FONT></TH> |
| 288 |
</TR> |
| 289 |
</TABLE> |
| 290 |
|
| 291 |
<A NAME="getCommitToken()"></A><H3> |
| 292 |
getCommitToken</H3> |
| 293 |
<PRE> |
| 294 |
public byte[] <B>getCommitToken</B>() |
| 295 |
throws <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></PRE> |
| 296 |
<DL> |
| 297 |
<DD>Fetch the transaction's commit token. |
| 298 |
<p> |
| 299 |
This operation can only be performed after this transaction has committed. |
| 300 |
<P> |
| 301 |
<DD><DL> |
| 302 |
|
| 303 |
<DT><B>Returns:</B><DD>The commit token generated at the commit time of this transaction. |
| 304 |
<p> |
| 305 |
<DT><B>Throws:</B> |
| 306 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs |
| 307 |
<DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE></DL> |
| 308 |
</DD> |
| 309 |
</DL> |
| 310 |
<HR> |
| 311 |
|
| 312 |
<A NAME="abort()"></A><H3> |
| 313 |
abort</H3> |
| 314 |
<PRE> |
| 315 |
public void <B>abort</B>() |
| 316 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 317 |
<DL> |
| 318 |
<DD>Cause an abnormal termination of the transaction. |
| 319 |
<p> |
| 320 |
The log is played backward, and any necessary undo operations are done. |
| 321 |
Before Transaction.abort returns, any locks held by the transaction will |
| 322 |
have been released. |
| 323 |
<p> |
| 324 |
In the case of nested transactions, aborting a parent transaction |
| 325 |
causes all children (unresolved or not) of the parent transaction |
| 326 |
to be aborted. |
| 327 |
<p> |
| 328 |
All cursors opened within the transaction must be closed before the |
| 329 |
transaction is aborted. |
| 330 |
This method closes all open <A HREF="../../../com/sleepycat/db/Cursor.html" title="class in com.sleepycat.db"><CODE>Cursor</CODE></A> handles. |
| 331 |
And if a close operation fails, the rest of |
| 332 |
the cursors are closed, and the database environment is set to the panic state. |
| 333 |
<p> |
| 334 |
After Transaction.abort has been called, regardless of its return, the |
| 335 |
<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db"><CODE>Transaction</CODE></A> handle may not be accessed again. |
| 336 |
<p> |
| 337 |
<p> |
| 338 |
<P> |
| 339 |
<DD><DL> |
| 340 |
|
| 341 |
<DT><B>Throws:</B> |
| 342 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL> |
| 343 |
</DD> |
| 344 |
</DL> |
| 345 |
<HR> |
| 346 |
|
| 347 |
<A NAME="commit()"></A><H3> |
| 348 |
commit</H3> |
| 349 |
<PRE> |
| 350 |
public void <B>commit</B>() |
| 351 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 352 |
<DL> |
| 353 |
<DD>End the transaction. If the environment is configured for synchronous |
| 354 |
commit, the transaction will be committed synchronously to stable |
| 355 |
storage before the call returns. This means the transaction will exhibit |
| 356 |
all of the ACID (atomicity, consistency, isolation, and durability) |
| 357 |
properties. |
| 358 |
<p> |
| 359 |
If the environment is not configured for synchronous commit, the commit |
| 360 |
will not necessarily have been committed to stable storage before the |
| 361 |
call returns. This means the transaction will exhibit the ACI (atomicity, |
| 362 |
consistency, and isolation) properties, but not D (durability); that is, |
| 363 |
database integrity will be maintained, but it is possible this transaction |
| 364 |
may be undone during recovery. |
| 365 |
<p> |
| 366 |
In the case of nested transactions, if the transaction is a parent |
| 367 |
transaction, committing the parent transaction causes all unresolved |
| 368 |
children of the parent to be committed. In the case of nested |
| 369 |
transactions, if the transaction is a child transaction, its locks are |
| 370 |
not released, but are acquired by its parent. Although the commit of the |
| 371 |
child transaction will succeed, the actual resolution of the child |
| 372 |
transaction is postponed until the parent transaction is committed or |
| 373 |
aborted; that is, if its parent transaction commits, it will be |
| 374 |
committed; and if its parent transaction aborts, it will be aborted. |
| 375 |
<p> |
| 376 |
All cursors opened within the transaction must be closed before the |
| 377 |
transaction is committed. |
| 378 |
If there are <A HREF="../../../com/sleepycat/db/Cursor.html" title="class in com.sleepycat.db"><CODE>Cursor</CODE></A> handles |
| 379 |
open when this method is called, they are all closed inside this method. And |
| 380 |
if there are errors when closing the cursor handles, the transaction |
| 381 |
is aborted and the first such error is returned. |
| 382 |
<p> |
| 383 |
After this method returns, the <A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db"><CODE>Transaction</CODE></A> handle may not be |
| 384 |
accessed again (except to retrieve the commit token), |
| 385 |
regardless of the method's success or failure. If the |
| 386 |
method encounters an error, the transaction and all child transactions |
| 387 |
of the transaction will have been aborted when the call returns. |
| 388 |
<p> |
| 389 |
<p> |
| 390 |
<P> |
| 391 |
<DD><DL> |
| 392 |
|
| 393 |
<DT><B>Throws:</B> |
| 394 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL> |
| 395 |
</DD> |
| 396 |
</DL> |
| 397 |
<HR> |
| 398 |
|
| 399 |
<A NAME="commitSync()"></A><H3> |
| 400 |
commitSync</H3> |
| 401 |
<PRE> |
| 402 |
public void <B>commitSync</B>() |
| 403 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 404 |
<DL> |
| 405 |
<DD>End the transaction, committing synchronously. This means the |
| 406 |
transaction will exhibit all of the ACID (atomicity, consistency, |
| 407 |
isolation, and durability) properties. |
| 408 |
<p> |
| 409 |
This behavior is the default for database environments unless otherwise |
| 410 |
configured using the <A HREF="../../../com/sleepycat/db/EnvironmentConfig.html#setTxnNoSync(boolean)"><CODE>EnvironmentConfig.setTxnNoSync</CODE></A> method. This |
| 411 |
behavior may also be set for a single transaction using the |
| 412 |
<A HREF="../../../com/sleepycat/db/Environment.html#beginTransaction(com.sleepycat.db.Transaction, com.sleepycat.db.TransactionConfig)"><CODE>Environment.beginTransaction</CODE></A> method. Any value specified to |
| 413 |
this method overrides both of those settings. |
| 414 |
<p> |
| 415 |
In the case of nested transactions, if the transaction is a parent |
| 416 |
transaction, committing the parent transaction causes all unresolved |
| 417 |
children of the parent to be committed. In the case of nested |
| 418 |
transactions, if the transaction is a child transaction, its locks are |
| 419 |
not released, but are acquired by its parent. Although the commit of the |
| 420 |
child transaction will succeed, the actual resolution of the child |
| 421 |
transaction is postponed until the parent transaction is committed or |
| 422 |
aborted; that is, if its parent transaction commits, it will be |
| 423 |
committed; and if its parent transaction aborts, it will be aborted. |
| 424 |
<p> |
| 425 |
All cursors opened within the transaction must be closed before the |
| 426 |
transaction is committed. |
| 427 |
If there are <A HREF="../../../com/sleepycat/db/Cursor.html" title="class in com.sleepycat.db"><CODE>Cursor</CODE></A> handles |
| 428 |
open when this method is called, they are all closed inside this method. And |
| 429 |
if there are errors when closing the cursor handles, the transaction |
| 430 |
is aborted and the first such error is returned. |
| 431 |
<p> |
| 432 |
After this method returns, the <A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db"><CODE>Transaction</CODE></A> handle may not be |
| 433 |
accessed again (except to retrieve the commit token), |
| 434 |
regardless of the method's success or failure. If the |
| 435 |
method encounters an error, the transaction and all child transactions |
| 436 |
of the transaction will have been aborted when the call returns. |
| 437 |
<p> |
| 438 |
<p> |
| 439 |
<P> |
| 440 |
<DD><DL> |
| 441 |
|
| 442 |
<DT><B>Throws:</B> |
| 443 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL> |
| 444 |
</DD> |
| 445 |
</DL> |
| 446 |
<HR> |
| 447 |
|
| 448 |
<A NAME="commitNoSync()"></A><H3> |
| 449 |
commitNoSync</H3> |
| 450 |
<PRE> |
| 451 |
public void <B>commitNoSync</B>() |
| 452 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 453 |
<DL> |
| 454 |
<DD>End the transaction, not committing synchronously. |
| 455 |
This means the |
| 456 |
transaction will exhibit the ACI (atomicity, consistency, and isolation) |
| 457 |
properties, but not D (durability); that is, database integrity will be |
| 458 |
maintained, but it is possible this transaction may be undone during |
| 459 |
recovery. |
| 460 |
<p> |
| 461 |
This behavior may be set for a database environment using the |
| 462 |
<A HREF="../../../com/sleepycat/db/EnvironmentConfig.html#setTxnNoSync(boolean)"><CODE>EnvironmentConfig.setTxnNoSync</CODE></A> method or for a single transaction |
| 463 |
using the <A HREF="../../../com/sleepycat/db/Environment.html#beginTransaction(com.sleepycat.db.Transaction, com.sleepycat.db.TransactionConfig)"><CODE>Environment.beginTransaction</CODE></A> method. Any value |
| 464 |
specified to this method overrides both of those settings. |
| 465 |
<p> |
| 466 |
In the case of nested transactions, if the transaction is a parent |
| 467 |
transaction, committing the parent transaction causes all unresolved |
| 468 |
children of the parent to be committed. In the case of nested |
| 469 |
transactions, if the transaction is a child transaction, its locks are |
| 470 |
not released, but are acquired by its parent. Although the commit of the |
| 471 |
child transaction will succeed, the actual resolution of the child |
| 472 |
transaction is postponed until the parent transaction is committed or |
| 473 |
aborted; that is, if its parent transaction commits, it will be |
| 474 |
committed; and if its parent transaction aborts, it will be aborted. |
| 475 |
<p> |
| 476 |
All cursors opened within the transaction must be closed before the |
| 477 |
transaction is committed. |
| 478 |
If there are <A HREF="../../../com/sleepycat/db/Cursor.html" title="class in com.sleepycat.db"><CODE>Cursor</CODE></A> handles |
| 479 |
open when this method is called, they are all closed inside this method. And |
| 480 |
if there are errors when closing the cursor handles, the transaction |
| 481 |
is aborted and the first such error is returned. |
| 482 |
<p> |
| 483 |
After this method returns, the <A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db"><CODE>Transaction</CODE></A> handle may not be |
| 484 |
accessed again (except to retrieve the commit token), |
| 485 |
regardless of the method's success or failure. If the |
| 486 |
method encounters an error, the transaction and all child transactions |
| 487 |
of the transaction will have been aborted when the call returns. |
| 488 |
<p> |
| 489 |
<p> |
| 490 |
<P> |
| 491 |
<DD><DL> |
| 492 |
|
| 493 |
<DT><B>Throws:</B> |
| 494 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL> |
| 495 |
</DD> |
| 496 |
</DL> |
| 497 |
<HR> |
| 498 |
|
| 499 |
<A NAME="commitWriteNoSync()"></A><H3> |
| 500 |
commitWriteNoSync</H3> |
| 501 |
<PRE> |
| 502 |
public void <B>commitWriteNoSync</B>() |
| 503 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 504 |
<DL> |
| 505 |
<DD>End the transaction, writing but not flushing the log. |
| 506 |
This means the |
| 507 |
transaction will exhibit the ACI (atomicity, consistency, and isolation) |
| 508 |
properties, but not D (durability); that is, database integrity will be |
| 509 |
maintained, but it is possible this transaction may be undone during |
| 510 |
recovery in the event that the operating system crashes. This option |
| 511 |
provides more durability than an asynchronous commit and has less |
| 512 |
performance cost than a synchronous commit. |
| 513 |
<p> |
| 514 |
This behavior may be set for a database environment using the |
| 515 |
<A HREF="../../../com/sleepycat/db/EnvironmentConfig.html#setTxnWriteNoSync(boolean)"><CODE>EnvironmentConfig.setTxnWriteNoSync</CODE></A> method or for a single |
| 516 |
transaction using the <A HREF="../../../com/sleepycat/db/Environment.html#beginTransaction(com.sleepycat.db.Transaction, com.sleepycat.db.TransactionConfig)"><CODE>Environment.beginTransaction</CODE></A> method. |
| 517 |
Any value specified to this method overrides both of those settings. |
| 518 |
<p> |
| 519 |
In the case of nested transactions, if the transaction is a parent |
| 520 |
transaction, committing the parent transaction causes all unresolved |
| 521 |
children of the parent to be committed. In the case of nested |
| 522 |
transactions, if the transaction is a child transaction, its locks are |
| 523 |
not released, but are acquired by its parent. Although the commit of the |
| 524 |
child transaction will succeed, the actual resolution of the child |
| 525 |
transaction is postponed until the parent transaction is committed or |
| 526 |
aborted; that is, if its parent transaction commits, it will be |
| 527 |
committed; and if its parent transaction aborts, it will be aborted. |
| 528 |
<p> |
| 529 |
All cursors opened within the transaction must be closed before the |
| 530 |
transaction is committed. |
| 531 |
If there are <A HREF="../../../com/sleepycat/db/Cursor.html" title="class in com.sleepycat.db"><CODE>Cursor</CODE></A> handles |
| 532 |
open when this method is called, they are all closed inside this method. And |
| 533 |
if there are errors when closing the cursor handles, the transaction |
| 534 |
is aborted and the first such error is returned. |
| 535 |
<p> |
| 536 |
After this method returns, the <A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db"><CODE>Transaction</CODE></A> handle may not be |
| 537 |
accessed again (except to retrieve the commit token), |
| 538 |
regardless of the method's success or failure. If the |
| 539 |
method encounters an error, the transaction and all child transactions |
| 540 |
of the transaction will have been aborted when the call returns. |
| 541 |
<p> |
| 542 |
<p> |
| 543 |
<P> |
| 544 |
<DD><DL> |
| 545 |
|
| 546 |
<DT><B>Throws:</B> |
| 547 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL> |
| 548 |
</DD> |
| 549 |
</DL> |
| 550 |
<HR> |
| 551 |
|
| 552 |
<A NAME="discard()"></A><H3> |
| 553 |
discard</H3> |
| 554 |
<PRE> |
| 555 |
public void <B>discard</B>() |
| 556 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 557 |
<DL> |
| 558 |
<DD>Free up all the per-process resources associated with the specified |
| 559 |
<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db"><CODE>Transaction</CODE></A> handle, neither committing nor aborting the |
| 560 |
transaction. This call may be used only after calls to |
| 561 |
<A HREF="../../../com/sleepycat/db/Environment.html#recover(int, boolean)"><CODE>Environment.recover</CODE></A> when there are multiple global |
| 562 |
transaction managers recovering transactions in a single database |
| 563 |
environment. Any transactions returned by <A HREF="../../../com/sleepycat/db/Environment.html#recover(int, boolean)"><CODE>Environment.recover</CODE></A> that are not handled by the current global transaction |
| 564 |
manager should be discarded using this method. |
| 565 |
If there are <A HREF="../../../com/sleepycat/db/Cursor.html" title="class in com.sleepycat.db"><CODE>Cursor</CODE></A> handles |
| 566 |
open when this method is called, they are all closed inside this method. And |
| 567 |
if there are errors when closing the cursor handles, the first such error is returned. |
| 568 |
<p> |
| 569 |
The <A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db"><CODE>Transaction</CODE></A> handle may not be accessed again after this |
| 570 |
method has been called, regardless of the method's success or failure. |
| 571 |
<p> |
| 572 |
<p> |
| 573 |
<P> |
| 574 |
<DD><DL> |
| 575 |
|
| 576 |
<DT><B>Throws:</B> |
| 577 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL> |
| 578 |
</DD> |
| 579 |
</DL> |
| 580 |
<HR> |
| 581 |
|
| 582 |
<A NAME="getId()"></A><H3> |
| 583 |
getId</H3> |
| 584 |
<PRE> |
| 585 |
public int <B>getId</B>() |
| 586 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 587 |
<DL> |
| 588 |
<DD>Return the transaction's unique ID. |
| 589 |
<p> |
| 590 |
Locking calls made on behalf of this transaction should use the |
| 591 |
value returned from this method as the locker parameter to the |
| 592 |
<A HREF="../../../com/sleepycat/db/Environment.html#getLock(int, boolean, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.LockRequestMode)"><CODE>Environment.getLock</CODE></A> or <A HREF="../../../com/sleepycat/db/Environment.html#lockVector(int, boolean, com.sleepycat.db.LockRequest[])"><CODE>Environment.lockVector</CODE></A> |
| 593 |
calls. |
| 594 |
<p> |
| 595 |
<P> |
| 596 |
<DD><DL> |
| 597 |
|
| 598 |
<DT><B>Returns:</B><DD>The transaction's unique ID. |
| 599 |
<p> |
| 600 |
<p> |
| 601 |
<DT><B>Throws:</B> |
| 602 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL> |
| 603 |
</DD> |
| 604 |
</DL> |
| 605 |
<HR> |
| 606 |
|
| 607 |
<A NAME="getName()"></A><H3> |
| 608 |
getName</H3> |
| 609 |
<PRE> |
| 610 |
public <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>getName</B>() |
| 611 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 612 |
<DL> |
| 613 |
<DD>Get the user visible name for the transaction. |
| 614 |
<p> |
| 615 |
<P> |
| 616 |
<DD><DL> |
| 617 |
|
| 618 |
<DT><B>Returns:</B><DD>The user visible name for the transaction. |
| 619 |
<p> |
| 620 |
<DT><B>Throws:</B> |
| 621 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> |
| 622 |
</DD> |
| 623 |
</DL> |
| 624 |
<HR> |
| 625 |
|
| 626 |
<A NAME="getPriority()"></A><H3> |
| 627 |
getPriority</H3> |
| 628 |
<PRE> |
| 629 |
public int <B>getPriority</B>() |
| 630 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 631 |
<DL> |
| 632 |
<DD>Get the transaction's deadlock priority. |
| 633 |
<p> |
| 634 |
<P> |
| 635 |
<DD><DL> |
| 636 |
|
| 637 |
<DT><B>Returns:</B><DD>The deadlock priority for the transaction. |
| 638 |
<p> |
| 639 |
<DT><B>Throws:</B> |
| 640 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs</DL> |
| 641 |
</DD> |
| 642 |
</DL> |
| 643 |
<HR> |
| 644 |
|
| 645 |
<A NAME="prepare(byte[])"></A><H3> |
| 646 |
prepare</H3> |
| 647 |
<PRE> |
| 648 |
public void <B>prepare</B>(byte[] gid) |
| 649 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 650 |
<DL> |
| 651 |
<DD>Initiate the beginning of a two-phase commit. |
| 652 |
<p> |
| 653 |
In a distributed transaction environment, Berkeley DB can be used |
| 654 |
as a local transaction manager. In this case, the distributed |
| 655 |
transaction manager must send <em>prepare</em> messages to each |
| 656 |
local manager. The local manager must then issue a |
| 657 |
<A HREF="../../../com/sleepycat/db/Transaction.html#prepare(byte[])"><CODE>Transaction.prepare</CODE></A> call and await its successful return |
| 658 |
before responding to the distributed transaction manager. Only |
| 659 |
after the distributed transaction manager receives successful |
| 660 |
responses from all of its <em>prepare</em> messages should it issue |
| 661 |
any <em>commit</em> messages. |
| 662 |
<p> |
| 663 |
In the case of nested transactions, preparing the parent causes all |
| 664 |
unresolved children of the parent transaction to be committed. |
| 665 |
Child transactions should never be explicitly prepared. Their fate |
| 666 |
will be resolved along with their parent's during global recovery. |
| 667 |
<p> |
| 668 |
If there are <A HREF="../../../com/sleepycat/db/Cursor.html" title="class in com.sleepycat.db"><CODE>Cursor</CODE></A> handles |
| 669 |
open when this method is called, they are all closed inside this method. And |
| 670 |
if there are errors when closing the cursor handles, the first such error is returned. |
| 671 |
<p> |
| 672 |
<P> |
| 673 |
<DD><DL> |
| 674 |
<DT><B>Parameters:</B><DD><CODE>gid</CODE> - The global transaction ID by which this transaction will be known. |
| 675 |
This global transaction ID will be returned in calls to |
| 676 |
<A HREF="../../../com/sleepycat/db/Environment.html#recover(int, boolean)"><CODE>Environment.recover</CODE></A> method, telling the application which |
| 677 |
global transactions must be resolved. The gid parameter must be sized |
| 678 |
at least DB_XIDDATASIZE (currently 128) bytes; only the first |
| 679 |
DB_XIDDATASIZE bytes are used. |
| 680 |
<p> |
| 681 |
<p> |
| 682 |
<DT><B>Throws:</B> |
| 683 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL> |
| 684 |
</DD> |
| 685 |
</DL> |
| 686 |
<HR> |
| 687 |
|
| 688 |
<A NAME="setName(java.lang.String)"></A><H3> |
| 689 |
setName</H3> |
| 690 |
<PRE> |
| 691 |
public void <B>setName</B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> name) |
| 692 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 693 |
<DL> |
| 694 |
<DD>Set the user visible name for the transaction. |
| 695 |
<p> |
| 696 |
<P> |
| 697 |
<DD><DL> |
| 698 |
<DT><B>Parameters:</B><DD><CODE>name</CODE> - The user visible name for the transaction. |
| 699 |
<p> |
| 700 |
<DT><B>Throws:</B> |
| 701 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> |
| 702 |
</DD> |
| 703 |
</DL> |
| 704 |
<HR> |
| 705 |
|
| 706 |
<A NAME="setPriority(int)"></A><H3> |
| 707 |
setPriority</H3> |
| 708 |
<PRE> |
| 709 |
public void <B>setPriority</B>(int priority) |
| 710 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 711 |
<DL> |
| 712 |
<DD>Set the deadlock priority for this transaction. The deadlock detector will |
| 713 |
reject lock requests from lower priority transactions before those from |
| 714 |
higher priority transactions. |
| 715 |
<p> |
| 716 |
<P> |
| 717 |
<DD><DL> |
| 718 |
<DT><B>Parameters:</B><DD><CODE>priority</CODE> - The deadlock priority for the transaction. |
| 719 |
<p> |
| 720 |
<DT><B>Throws:</B> |
| 721 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL> |
| 722 |
</DD> |
| 723 |
</DL> |
| 724 |
<HR> |
| 725 |
|
| 726 |
<A NAME="setTxnTimeout(long)"></A><H3> |
| 727 |
setTxnTimeout</H3> |
| 728 |
<PRE> |
| 729 |
public void <B>setTxnTimeout</B>(long timeOut) |
| 730 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 731 |
<DL> |
| 732 |
<DD>Configure the timeout value for the transaction lifetime. |
| 733 |
<p> |
| 734 |
If the transaction runs longer than this time, the transaction may |
| 735 |
may throw <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db"><CODE>DatabaseException</CODE></A>. |
| 736 |
<p> |
| 737 |
Timeouts are checked whenever a thread of control blocks on a lock |
| 738 |
or when deadlock detection is performed. For this reason, the |
| 739 |
accuracy of the timeout depends on how often deadlock detection is |
| 740 |
performed. |
| 741 |
<p> |
| 742 |
<P> |
| 743 |
<DD><DL> |
| 744 |
<DT><B>Parameters:</B><DD><CODE>timeOut</CODE> - The timeout value for the transaction lifetime, in microseconds. As |
| 745 |
the value is an unsigned 32-bit number of microseconds, the maximum |
| 746 |
timeout is roughly 71 minutes. A value of 0 disables timeouts for |
| 747 |
the transaction. |
| 748 |
<p> |
| 749 |
This method may be called at any time during the life of the application. |
| 750 |
<p> |
| 751 |
<p> |
| 752 |
<DT><B>Throws:</B> |
| 753 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL> |
| 754 |
</DD> |
| 755 |
</DL> |
| 756 |
<HR> |
| 757 |
|
| 758 |
<A NAME="setLockTimeout(long)"></A><H3> |
| 759 |
setLockTimeout</H3> |
| 760 |
<PRE> |
| 761 |
public void <B>setLockTimeout</B>(long timeOut) |
| 762 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 763 |
<DL> |
| 764 |
<DD>Configure the lock request timeout value for the transaction. |
| 765 |
<p> |
| 766 |
If a lock request cannot be granted in this time, the transaction |
| 767 |
may throw <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db"><CODE>DatabaseException</CODE></A>. |
| 768 |
<p> |
| 769 |
Timeouts are checked whenever a thread of control blocks on a lock |
| 770 |
or when deadlock detection is performed. For this reason, the |
| 771 |
accuracy of the timeout depends on how often deadlock detection is |
| 772 |
performed. |
| 773 |
<p> |
| 774 |
<P> |
| 775 |
<DD><DL> |
| 776 |
<DT><B>Parameters:</B><DD><CODE>timeOut</CODE> - The lock request timeout value for the transaction, in microseconds. |
| 777 |
As the value is an unsigned 32-bit number of microseconds, the maximum |
| 778 |
timeout is roughly 71 minutes. A value of 0 disables timeouts for the |
| 779 |
transaction. |
| 780 |
<p> |
| 781 |
This method may be called at any time during the life of the application. |
| 782 |
<p> |
| 783 |
<p> |
| 784 |
<DT><B>Throws:</B> |
| 785 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL> |
| 786 |
</DD> |
| 787 |
</DL> |
| 788 |
|
| 789 |
<HR> |
| 790 |
|
| 791 |
|
| 792 |
|
| 793 |
<A NAME="navbar_bottom"></A> |
| 794 |
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> |
| 795 |
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> |
| 796 |
<TR> |
| 797 |
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
| 798 |
<A NAME="navbar_bottom_firstrow"></A> |
| 799 |
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> |
| 800 |
<TR ALIGN="center" VALIGN="top"> |
| 801 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
| 802 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
| 803 |
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
| 804 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Transaction.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> |
| 805 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
| 806 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
| 807 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
| 808 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
| 809 |
</TR> |
| 810 |
</TABLE> |
| 811 |
</TD> |
| 812 |
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
| 813 |
<b>Berkeley DB</b><br><font size="-1"> version 5.3.28</font></EM> |
| 814 |
</TD> |
| 815 |
</TR> |
| 816 |
|
| 817 |
<TR> |
| 818 |
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| 819 |
<A HREF="../../../com/sleepycat/db/StatsConfig.html" title="class in com.sleepycat.db"><B>PREV CLASS</B></A> |
| 820 |
<A HREF="../../../com/sleepycat/db/TransactionConfig.html" title="class in com.sleepycat.db"><B>NEXT CLASS</B></A></FONT></TD> |
| 821 |
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| 822 |
<A HREF="../../../index.html?com/sleepycat/db/Transaction.html" target="_top"><B>FRAMES</B></A> |
| 823 |
<A HREF="Transaction.html" target="_top"><B>NO FRAMES</B></A> |
| 824 |
<SCRIPT type="text/javascript"> |
| 825 |
<!-- |
| 826 |
if(window==top) { |
| 827 |
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); |
| 828 |
} |
| 829 |
//--> |
| 830 |
</SCRIPT> |
| 831 |
<NOSCRIPT> |
| 832 |
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> |
| 833 |
</NOSCRIPT> |
| 834 |
|
| 835 |
|
| 836 |
</FONT></TD> |
| 837 |
</TR> |
| 838 |
<TR> |
| 839 |
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| 840 |
SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> |
| 841 |
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| 842 |
DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> |
| 843 |
</TR> |
| 844 |
</TABLE> |
| 845 |
<A NAME="skip-navbar_bottom"></A> |
| 846 |
|
| 847 |
|
| 848 |
<HR> |
| 849 |
<font size=1>Copyright (c) 1996, 2013 Oracle and/or its affiliates. All rights reserved.</font> |
| 850 |
</BODY> |
| 851 |
</HTML> |