1021 lines
52 KiB
HTML
1021 lines
52 KiB
HTML
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||
|
<!-- NewPage -->
|
||
|
<html lang="en">
|
||
|
<head>
|
||
|
<!-- Generated by javadoc (1.8.0_151) on Tue Oct 31 17:36:46 EDT 2017 -->
|
||
|
<title>Transaction (Oracle - Berkeley DB Java Edition API)</title>
|
||
|
<meta name="date" content="2017-10-31">
|
||
|
<link rel="stylesheet" type="text/css" href="../../../style.css" title="Style">
|
||
|
<script type="text/javascript" src="../../../script.js"></script>
|
||
|
</head>
|
||
|
<body>
|
||
|
<script type="text/javascript"><!--
|
||
|
try {
|
||
|
if (location.href.indexOf('is-external=true') == -1) {
|
||
|
parent.document.title="Transaction (Oracle - Berkeley DB Java Edition API)";
|
||
|
}
|
||
|
}
|
||
|
catch(err) {
|
||
|
}
|
||
|
//-->
|
||
|
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":42,"i14":10,"i15":10,"i16":42,"i17":10,"i18":10};
|
||
|
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"],32:["t6","Deprecated Methods"]};
|
||
|
var altColor = "altColor";
|
||
|
var rowColor = "rowColor";
|
||
|
var tableTab = "tableTab";
|
||
|
var activeTableTab = "activeTableTab";
|
||
|
</script>
|
||
|
<noscript>
|
||
|
<div>JavaScript is disabled on your browser.</div>
|
||
|
</noscript>
|
||
|
<!-- ========= START OF TOP NAVBAR ======= -->
|
||
|
<div class="topNav"><a name="navbar.top">
|
||
|
<!-- -->
|
||
|
</a>
|
||
|
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
|
||
|
<a name="navbar.top.firstrow">
|
||
|
<!-- -->
|
||
|
</a>
|
||
|
<ul class="navList" title="Navigation">
|
||
|
<li><a href="../../../overview-summary.html">Overview</a></li>
|
||
|
<li><a href="package-summary.html">Package</a></li>
|
||
|
<li class="navBarCell1Rev">Class</li>
|
||
|
<li><a href="class-use/Transaction.html">Use</a></li>
|
||
|
<li><a href="package-tree.html">Tree</a></li>
|
||
|
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
|
||
|
<li><a href="../../../index-all.html">Index</a></li>
|
||
|
<li><a href="../../../help-doc.html">Help</a></li>
|
||
|
</ul>
|
||
|
<div class="aboutLanguage"><b>Berkeley DB Java Edition</b><br><font size=\"-1\"> version 7.5.11</font>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="subNav">
|
||
|
<ul class="navList">
|
||
|
<li><a href="../../../com/sleepycat/je/ThreadInterruptedException.html" title="class in com.sleepycat.je"><span class="typeNameLink">Prev Class</span></a></li>
|
||
|
<li><a href="../../../com/sleepycat/je/Transaction.State.html" title="enum in com.sleepycat.je"><span class="typeNameLink">Next Class</span></a></li>
|
||
|
</ul>
|
||
|
<ul class="navList">
|
||
|
<li><a href="../../../index.html?com/sleepycat/je/Transaction.html" target="_top">Frames</a></li>
|
||
|
<li><a href="Transaction.html" target="_top">No Frames</a></li>
|
||
|
</ul>
|
||
|
<ul class="navList" id="allclasses_navbar_top">
|
||
|
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
|
||
|
</ul>
|
||
|
<div>
|
||
|
<script type="text/javascript"><!--
|
||
|
allClassesLink = document.getElementById("allclasses_navbar_top");
|
||
|
if(window==top) {
|
||
|
allClassesLink.style.display = "block";
|
||
|
}
|
||
|
else {
|
||
|
allClassesLink.style.display = "none";
|
||
|
}
|
||
|
//-->
|
||
|
</script>
|
||
|
</div>
|
||
|
<div>
|
||
|
<ul class="subNavList">
|
||
|
<li>Summary: </li>
|
||
|
<li><a href="#nested.class.summary">Nested</a> | </li>
|
||
|
<li>Field | </li>
|
||
|
<li>Constr | </li>
|
||
|
<li><a href="#method.summary">Method</a></li>
|
||
|
</ul>
|
||
|
<ul class="subNavList">
|
||
|
<li>Detail: </li>
|
||
|
<li>Field | </li>
|
||
|
<li>Constr | </li>
|
||
|
<li><a href="#method.detail">Method</a></li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<a name="skip.navbar.top">
|
||
|
<!-- -->
|
||
|
</a></div>
|
||
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
||
|
<!-- ======== START OF CLASS DATA ======== -->
|
||
|
<div class="header">
|
||
|
<div class="subTitle">com.sleepycat.je</div>
|
||
|
<h2 title="Class Transaction" class="title">Class Transaction</h2>
|
||
|
</div>
|
||
|
<div class="contentContainer">
|
||
|
<ul class="inheritance">
|
||
|
<li>java.lang.Object</li>
|
||
|
<li>
|
||
|
<ul class="inheritance">
|
||
|
<li>com.sleepycat.je.Transaction</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<div class="description">
|
||
|
<ul class="blockList">
|
||
|
<li class="blockList">
|
||
|
<hr>
|
||
|
<br>
|
||
|
<pre>public class <span class="typeNameLabel">Transaction</span>
|
||
|
extends java.lang.Object</pre>
|
||
|
<div class="block">The Transaction object is the handle for a transaction. Methods off the
|
||
|
transaction handle are used to configure, abort and commit the transaction.
|
||
|
Transaction handles are provided to other Berkeley DB methods in order to
|
||
|
transactionally protect those operations.
|
||
|
|
||
|
<p>A single Transaction may be used to protect operations for any number of
|
||
|
Databases in a given environment. However, a single Transaction may not be
|
||
|
used for operations in more than one distinct environment.</p>
|
||
|
|
||
|
<p>Transaction handles are free-threaded; transactions handles may be used
|
||
|
concurrently by multiple threads. Once the <a href="../../../com/sleepycat/je/Transaction.html#abort--"><code>Transaction.abort</code></a> or <a href="../../../com/sleepycat/je/Transaction.html#commit--"><code>Transaction.commit</code></a> method
|
||
|
is called, the handle may not be accessed again, regardless of the success
|
||
|
or failure of the method, with one exception: the <code>abort</code> method may
|
||
|
be called any number of times to simplify error handling.</p>
|
||
|
|
||
|
<p>To obtain a transaction with default attributes:</p>
|
||
|
|
||
|
<blockquote><pre>
|
||
|
Transaction txn = myEnvironment.beginTransaction(null, null);
|
||
|
</pre></blockquote>
|
||
|
|
||
|
<p>To customize the attributes of a transaction:</p>
|
||
|
|
||
|
<blockquote><pre>
|
||
|
TransactionConfig config = new TransactionConfig();
|
||
|
config.setReadUncommitted(true);
|
||
|
Transaction txn = myEnvironment.beginTransaction(null, config);
|
||
|
</pre></blockquote></div>
|
||
|
</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<div class="summary">
|
||
|
<ul class="blockList">
|
||
|
<li class="blockList">
|
||
|
<!-- ======== NESTED CLASS SUMMARY ======== -->
|
||
|
<ul class="blockList">
|
||
|
<li class="blockList"><a name="nested.class.summary">
|
||
|
<!-- -->
|
||
|
</a>
|
||
|
<h3>Nested Class Summary</h3>
|
||
|
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation">
|
||
|
<caption><span>Nested Classes</span><span class="tabEnd"> </span></caption>
|
||
|
<tr>
|
||
|
<th class="colFirst" scope="col">Modifier and Type</th>
|
||
|
<th class="colLast" scope="col">Class and Description</th>
|
||
|
</tr>
|
||
|
<tr class="altColor">
|
||
|
<td class="colFirst"><code>static class </code></td>
|
||
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/Transaction.State.html" title="enum in com.sleepycat.je">Transaction.State</a></span></code>
|
||
|
<div class="block">The current state of the transaction.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<!-- ========== METHOD SUMMARY =========== -->
|
||
|
<ul class="blockList">
|
||
|
<li class="blockList"><a name="method.summary">
|
||
|
<!-- -->
|
||
|
</a>
|
||
|
<h3>Method Summary</h3>
|
||
|
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
|
||
|
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span><span id="t6" class="tableTab"><span><a href="javascript:show(32);">Deprecated Methods</a></span><span class="tabEnd"> </span></span></caption>
|
||
|
<tr>
|
||
|
<th class="colFirst" scope="col">Modifier and Type</th>
|
||
|
<th class="colLast" scope="col">Method and Description</th>
|
||
|
</tr>
|
||
|
<tr id="i0" class="altColor">
|
||
|
<td class="colFirst"><code>void</code></td>
|
||
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/Transaction.html#abort--">abort</a></span>()</code>
|
||
|
<div class="block">Cause an abnormal termination of the transaction.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr id="i1" class="rowColor">
|
||
|
<td class="colFirst"><code>void</code></td>
|
||
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/Transaction.html#commit--">commit</a></span>()</code>
|
||
|
<div class="block">End the transaction.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr id="i2" class="altColor">
|
||
|
<td class="colFirst"><code>void</code></td>
|
||
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/Transaction.html#commit-com.sleepycat.je.Durability-">commit</a></span>(<a href="../../../com/sleepycat/je/Durability.html" title="class in com.sleepycat.je">Durability</a> durability)</code>
|
||
|
<div class="block">End the transaction using the specified durability requirements.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr id="i3" class="rowColor">
|
||
|
<td class="colFirst"><code>void</code></td>
|
||
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/Transaction.html#commitNoSync--">commitNoSync</a></span>()</code>
|
||
|
<div class="block">End the transaction, not writing to stable storage and not committing
|
||
|
synchronously.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr id="i4" class="altColor">
|
||
|
<td class="colFirst"><code>void</code></td>
|
||
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/Transaction.html#commitSync--">commitSync</a></span>()</code>
|
||
|
<div class="block">End the transaction, writing to stable storage and committing
|
||
|
synchronously.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr id="i5" class="rowColor">
|
||
|
<td class="colFirst"><code>void</code></td>
|
||
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/Transaction.html#commitWriteNoSync--">commitWriteNoSync</a></span>()</code>
|
||
|
<div class="block">End the transaction, writing to stable storage but not committing
|
||
|
synchronously.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr id="i6" class="altColor">
|
||
|
<td class="colFirst"><code><a href="../../../com/sleepycat/je/CommitToken.html" title="class in com.sleepycat.je">CommitToken</a></code></td>
|
||
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/Transaction.html#getCommitToken--">getCommitToken</a></span>()</code>
|
||
|
<div class="block">This method is intended for use with a replicated environment.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr id="i7" class="rowColor">
|
||
|
<td class="colFirst"><code>long</code></td>
|
||
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/Transaction.html#getId--">getId</a></span>()</code>
|
||
|
<div class="block">Return the transaction's unique ID.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr id="i8" class="altColor">
|
||
|
<td class="colFirst"><code>long</code></td>
|
||
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/Transaction.html#getLockTimeout-java.util.concurrent.TimeUnit-">getLockTimeout</a></span>(java.util.concurrent.TimeUnit unit)</code>
|
||
|
<div class="block">Returns the lock request timeout value for the transaction.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr id="i9" class="rowColor">
|
||
|
<td class="colFirst"><code>java.lang.String</code></td>
|
||
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/Transaction.html#getName--">getName</a></span>()</code>
|
||
|
<div class="block">Get the user visible name for the transaction.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr id="i10" class="altColor">
|
||
|
<td class="colFirst"><code><a href="../../../com/sleepycat/je/Transaction.State.html" title="enum in com.sleepycat.je">Transaction.State</a></code></td>
|
||
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/Transaction.html#getState--">getState</a></span>()</code>
|
||
|
<div class="block">Returns the current state of the transaction.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr id="i11" class="rowColor">
|
||
|
<td class="colFirst"><code>long</code></td>
|
||
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/Transaction.html#getTxnTimeout-java.util.concurrent.TimeUnit-">getTxnTimeout</a></span>(java.util.concurrent.TimeUnit unit)</code>
|
||
|
<div class="block">Returns the timeout value for the transaction lifetime.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr id="i12" class="altColor">
|
||
|
<td class="colFirst"><code>boolean</code></td>
|
||
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/Transaction.html#isValid--">isValid</a></span>()</code>
|
||
|
<div class="block">Returns whether this <code>Transaction</code> is open, which is equivalent
|
||
|
to when <a href="../../../com/sleepycat/je/Transaction.html#getState--"><code>getState()</code></a> returns <a href="../../../com/sleepycat/je/Transaction.State.html#OPEN"><code>Transaction.State.OPEN</code></a>.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr id="i13" class="rowColor">
|
||
|
<td class="colFirst"><code>void</code></td>
|
||
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/Transaction.html#setLockTimeout-long-">setLockTimeout</a></span>(long timeOut)</code>
|
||
|
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
|
||
|
<div class="block"><span class="deprecationComment">as of 4.0, replaced by <a href="../../../com/sleepycat/je/Transaction.html#setLockTimeout-long-java.util.concurrent.TimeUnit-"><code>setLockTimeout(long,
|
||
|
TimeUnit)</code></a>.</span></div>
|
||
|
</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr id="i14" class="altColor">
|
||
|
<td class="colFirst"><code>void</code></td>
|
||
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/Transaction.html#setLockTimeout-long-java.util.concurrent.TimeUnit-">setLockTimeout</a></span>(long timeOut,
|
||
|
java.util.concurrent.TimeUnit unit)</code>
|
||
|
<div class="block">Configures the lock request timeout value for the transaction.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr id="i15" class="rowColor">
|
||
|
<td class="colFirst"><code>void</code></td>
|
||
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/Transaction.html#setName-java.lang.String-">setName</a></span>(java.lang.String name)</code>
|
||
|
<div class="block">Set the user visible name for the transaction.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr id="i16" class="altColor">
|
||
|
<td class="colFirst"><code>void</code></td>
|
||
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/Transaction.html#setTxnTimeout-long-">setTxnTimeout</a></span>(long timeOut)</code>
|
||
|
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
|
||
|
<div class="block"><span class="deprecationComment">as of 4.0, replaced by <a href="../../../com/sleepycat/je/Transaction.html#setTxnTimeout-long-java.util.concurrent.TimeUnit-"><code>setTxnTimeout(long,
|
||
|
TimeUnit)</code></a>.</span></div>
|
||
|
</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr id="i17" class="rowColor">
|
||
|
<td class="colFirst"><code>void</code></td>
|
||
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/Transaction.html#setTxnTimeout-long-java.util.concurrent.TimeUnit-">setTxnTimeout</a></span>(long timeOut,
|
||
|
java.util.concurrent.TimeUnit unit)</code>
|
||
|
<div class="block">Configures the timeout value for the transaction lifetime.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr id="i18" class="altColor">
|
||
|
<td class="colFirst"><code>java.lang.String</code></td>
|
||
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/Transaction.html#toString--">toString</a></span>()</code> </td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
<ul class="blockList">
|
||
|
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
|
||
|
<!-- -->
|
||
|
</a>
|
||
|
<h3>Methods inherited from class java.lang.Object</h3>
|
||
|
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</code></li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<div class="details">
|
||
|
<ul class="blockList">
|
||
|
<li class="blockList">
|
||
|
<!-- ============ METHOD DETAIL ========== -->
|
||
|
<ul class="blockList">
|
||
|
<li class="blockList"><a name="method.detail">
|
||
|
<!-- -->
|
||
|
</a>
|
||
|
<h3>Method Detail</h3>
|
||
|
<a name="abort--">
|
||
|
<!-- -->
|
||
|
</a>
|
||
|
<ul class="blockList">
|
||
|
<li class="blockList">
|
||
|
<h4>abort</h4>
|
||
|
<pre>public void abort()
|
||
|
throws <a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">DatabaseException</a></pre>
|
||
|
<div class="block">Cause an abnormal termination of the transaction.
|
||
|
|
||
|
<p>The log is played backward, and any necessary undo operations are
|
||
|
done. Before Transaction.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 this method has been called, regardless of its return, the
|
||
|
<a href="../../../com/sleepycat/je/Transaction.html" title="class in com.sleepycat.je"><code>Transaction</code></a> handle may not be accessed again, with one
|
||
|
exception: the <code>abort</code> method itself may be called any number of
|
||
|
times to simplify error handling.</p>
|
||
|
|
||
|
<p>WARNING: To guard against memory leaks, the application should
|
||
|
discard all references to the closed handle. While BDB makes an effort
|
||
|
to discard references from closed objects to the allocated memory for an
|
||
|
environment, this behavior is not guaranteed. The safe course of action
|
||
|
for an application is to discard all references to closed BDB
|
||
|
objects.</p></div>
|
||
|
<dl>
|
||
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
||
|
<dd><code><a href="../../../com/sleepycat/je/EnvironmentFailureException.html" title="class in com.sleepycat.je">EnvironmentFailureException</a></code> - if an unexpected, internal or
|
||
|
environment-wide failure occurs.</dd>
|
||
|
<dd><code>java.lang.IllegalStateException</code> - if the environment has been closed, or
|
||
|
cursors associated with the transaction are still open.</dd>
|
||
|
<dd><code><a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">DatabaseException</a></code></dd>
|
||
|
</dl>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<a name="getId--">
|
||
|
<!-- -->
|
||
|
</a>
|
||
|
<ul class="blockList">
|
||
|
<li class="blockList">
|
||
|
<h4>getId</h4>
|
||
|
<pre>public long getId()</pre>
|
||
|
<div class="block">Return the transaction's unique ID.</div>
|
||
|
<dl>
|
||
|
<dt><span class="returnLabel">Returns:</span></dt>
|
||
|
<dd>The transaction's unique ID.</dd>
|
||
|
</dl>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<a name="getCommitToken--">
|
||
|
<!-- -->
|
||
|
</a>
|
||
|
<ul class="blockList">
|
||
|
<li class="blockList">
|
||
|
<h4>getCommitToken</h4>
|
||
|
<pre>public <a href="../../../com/sleepycat/je/CommitToken.html" title="class in com.sleepycat.je">CommitToken</a> getCommitToken()
|
||
|
throws java.lang.IllegalStateException</pre>
|
||
|
<div class="block">This method is intended for use with a replicated environment.
|
||
|
<p>
|
||
|
It returns the commitToken associated with a successful replicated
|
||
|
commit. A null value is returned if the txn was not associated with a
|
||
|
replicated environment, or the txn did not result in any changes to the
|
||
|
environment. This method should only be called after the transaction
|
||
|
has finished.
|
||
|
<p>
|
||
|
This method is typically used in conjunction with the <code>
|
||
|
CommitPointConsistencyPolicy</code>.</div>
|
||
|
<dl>
|
||
|
<dt><span class="returnLabel">Returns:</span></dt>
|
||
|
<dd>the token used to identify the replicated commit. Return null if
|
||
|
the transaction has aborted, or has committed without making any
|
||
|
updates.</dd>
|
||
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
||
|
<dd><code>java.lang.IllegalStateException</code> - if the method is called before the
|
||
|
transaction has committed or aborted.</dd>
|
||
|
<dt><span class="seeLabel">See Also:</span></dt>
|
||
|
<dd><a href="../../../com/sleepycat/je/rep/CommitPointConsistencyPolicy.html" title="class in com.sleepycat.je.rep"><code>CommitPointConsistencyPolicy</code></a></dd>
|
||
|
</dl>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<a name="commit--">
|
||
|
<!-- -->
|
||
|
</a>
|
||
|
<ul class="blockList">
|
||
|
<li class="blockList">
|
||
|
<h4>commit</h4>
|
||
|
<pre>public void commit()
|
||
|
throws <a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">DatabaseException</a></pre>
|
||
|
<div class="block">End the transaction. If the environment is configured for synchronous
|
||
|
commit, the transaction will be committed synchronously to stable
|
||
|
storage before the call returns. This means the transaction will
|
||
|
exhibit all of the ACID (atomicity, consistency, isolation, and
|
||
|
durability) properties.
|
||
|
|
||
|
<p>If the environment is not configured for synchronous commit, the
|
||
|
commit will not necessarily have been committed to stable storage before
|
||
|
the call returns. 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 this transaction may be undone during recovery.</p>
|
||
|
|
||
|
<p>All cursors opened within the transaction must be closed before the
|
||
|
transaction is committed.</p>
|
||
|
|
||
|
<p>If the method encounters an error, the transaction <!-- and all child
|
||
|
transactions of the transaction --> will have been aborted when the call
|
||
|
returns.</p>
|
||
|
|
||
|
<p>After this method has been called, regardless of its return, the
|
||
|
<a href="../../../com/sleepycat/je/Transaction.html" title="class in com.sleepycat.je"><code>Transaction</code></a> handle may not be accessed again, with one
|
||
|
exception: the <code>abort</code> method may be called any number of times
|
||
|
to simplify error handling.</p>
|
||
|
|
||
|
<p>WARNING: To guard against memory leaks, the application should
|
||
|
discard all references to the closed handle. While BDB makes an effort
|
||
|
to discard references from closed objects to the allocated memory for an
|
||
|
environment, this behavior is not guaranteed. The safe course of action
|
||
|
for an application is to discard all references to closed BDB
|
||
|
objects.</p></div>
|
||
|
<dl>
|
||
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
||
|
<dd><code><a href="../../../com/sleepycat/je/rep/InsufficientReplicasException.html" title="class in com.sleepycat.je.rep">InsufficientReplicasException</a></code> - if the master
|
||
|
in a replicated environment could not contact a quorum of replicas as
|
||
|
determined by the <a href="../../../com/sleepycat/je/Durability.ReplicaAckPolicy.html" title="enum in com.sleepycat.je"><code>Durability.ReplicaAckPolicy</code></a>.</dd>
|
||
|
<dd><code><a href="../../../com/sleepycat/je/rep/InsufficientAcksException.html" title="class in com.sleepycat.je.rep">InsufficientAcksException</a></code> - if the master in
|
||
|
a replicated environment did not receive enough replica acknowledgments,
|
||
|
although the commit succeeded locally.</dd>
|
||
|
<dd><code><a href="../../../com/sleepycat/je/rep/ReplicaWriteException.html" title="class in com.sleepycat.je.rep">ReplicaWriteException</a></code> - if a write operation
|
||
|
was performed with this transaction, but this node is now a Replica.</dd>
|
||
|
<dd><code><a href="../../../com/sleepycat/je/OperationFailureException.html" title="class in com.sleepycat.je">OperationFailureException</a></code> - if this exception occurred earlier and
|
||
|
caused the transaction to be invalidated.</dd>
|
||
|
<dd><code><a href="../../../com/sleepycat/je/EnvironmentFailureException.html" title="class in com.sleepycat.je">EnvironmentFailureException</a></code> - if an unexpected, internal or
|
||
|
environment-wide failure occurs.</dd>
|
||
|
<dd><code>java.lang.IllegalStateException</code> - if the transaction or environment has been
|
||
|
closed, or cursors associated with the transaction are still open.</dd>
|
||
|
<dd><code><a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">DatabaseException</a></code></dd>
|
||
|
</dl>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<a name="commit-com.sleepycat.je.Durability-">
|
||
|
<!-- -->
|
||
|
</a>
|
||
|
<ul class="blockList">
|
||
|
<li class="blockList">
|
||
|
<h4>commit</h4>
|
||
|
<pre>public void commit(<a href="../../../com/sleepycat/je/Durability.html" title="class in com.sleepycat.je">Durability</a> durability)
|
||
|
throws <a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">DatabaseException</a></pre>
|
||
|
<div class="block">End the transaction using the specified durability requirements. This
|
||
|
requirement overrides any default durability requirements associated
|
||
|
with the environment. If the durability requirements cannot be satisfied,
|
||
|
an exception is thrown to describe the problem. Please see
|
||
|
<a href="../../../com/sleepycat/je/Durability.html" title="class in com.sleepycat.je"><code>Durability</code></a> for specific exceptions that could result when the
|
||
|
durability requirements cannot be satisfied.
|
||
|
|
||
|
<p>All cursors opened within the transaction must be closed before the
|
||
|
transaction is committed.</p>
|
||
|
|
||
|
<p>If the method encounters an error, the transaction <!-- and all child
|
||
|
transactions of the transaction --> will have been aborted when the call
|
||
|
returns.</p>
|
||
|
|
||
|
<p>After this method has been called, regardless of its return, the
|
||
|
<a href="../../../com/sleepycat/je/Transaction.html" title="class in com.sleepycat.je"><code>Transaction</code></a> handle may not be accessed again, with one
|
||
|
exception: the <code>abort</code> method may be called any number of times
|
||
|
to simplify error handling.</p>
|
||
|
|
||
|
<p>WARNING: To guard against memory leaks, the application should
|
||
|
discard all references to the closed handle. While BDB makes an effort
|
||
|
to discard references from closed objects to the allocated memory for an
|
||
|
environment, this behavior is not guaranteed. The safe course of action
|
||
|
for an application is to discard all references to closed BDB
|
||
|
objects.</p></div>
|
||
|
<dl>
|
||
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
||
|
<dd><code>durability</code> - the durability requirements for this transaction</dd>
|
||
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
||
|
<dd><code><a href="../../../com/sleepycat/je/rep/InsufficientReplicasException.html" title="class in com.sleepycat.je.rep">InsufficientReplicasException</a></code> - if the master
|
||
|
in a replicated environment could not contact enough replicas to
|
||
|
initiate the commit.</dd>
|
||
|
<dd><code><a href="../../../com/sleepycat/je/rep/InsufficientAcksException.html" title="class in com.sleepycat.je.rep">InsufficientAcksException</a></code> - if the master in
|
||
|
a replicated environment did not receive enough replica acknowledgments,
|
||
|
althought the commit succeeded locally.</dd>
|
||
|
<dd><code><a href="../../../com/sleepycat/je/rep/ReplicaWriteException.html" title="class in com.sleepycat.je.rep">ReplicaWriteException</a></code> - if a write operation
|
||
|
was performed with this transaction, but this node is now a Replica.</dd>
|
||
|
<dd><code><a href="../../../com/sleepycat/je/OperationFailureException.html" title="class in com.sleepycat.je">OperationFailureException</a></code> - if this exception occurred earlier and
|
||
|
caused the transaction to be invalidated.</dd>
|
||
|
<dd><code><a href="../../../com/sleepycat/je/EnvironmentFailureException.html" title="class in com.sleepycat.je">EnvironmentFailureException</a></code> - if an unexpected, internal or
|
||
|
environment-wide failure occurs.</dd>
|
||
|
<dd><code>java.lang.IllegalStateException</code> - if the transaction or environment has been
|
||
|
closed, or cursors associated with the transaction are still open.</dd>
|
||
|
<dd><code>java.lang.IllegalArgumentException</code> - if an invalid parameter is specified.</dd>
|
||
|
<dd><code><a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">DatabaseException</a></code></dd>
|
||
|
</dl>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<a name="commitSync--">
|
||
|
<!-- -->
|
||
|
</a>
|
||
|
<ul class="blockList">
|
||
|
<li class="blockList">
|
||
|
<h4>commitSync</h4>
|
||
|
<pre>public void commitSync()
|
||
|
throws <a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">DatabaseException</a></pre>
|
||
|
<div class="block">End the transaction, writing to stable storage and committing
|
||
|
synchronously. This means the transaction will exhibit all of the ACID
|
||
|
(atomicity, consistency, isolation, and durability) properties.
|
||
|
|
||
|
<p>This behavior is the default for database environments unless
|
||
|
otherwise configured using the <a href="../../../com/sleepycat/je/EnvironmentMutableConfig.html#setTxnNoSync-boolean-"><code>EnvironmentConfig.setTxnNoSync</code></a> method. This behavior may also be set
|
||
|
for a single transaction using the <a href="../../../com/sleepycat/je/Environment.html#beginTransaction-com.sleepycat.je.Transaction-com.sleepycat.je.TransactionConfig-"><code>Environment.beginTransaction</code></a> method. Any value specified to this
|
||
|
method overrides both of those settings.</p>
|
||
|
|
||
|
<p>All cursors opened within the transaction must be closed before the
|
||
|
transaction is committed.</p>
|
||
|
|
||
|
<p>If the method encounters an error, the transaction <!-- and all child
|
||
|
transactions of the transaction --> will have been aborted when the call
|
||
|
returns.</p>
|
||
|
|
||
|
<p>After this method has been called, regardless of its return, the
|
||
|
<a href="../../../com/sleepycat/je/Transaction.html" title="class in com.sleepycat.je"><code>Transaction</code></a> handle may not be accessed again, with one
|
||
|
exception: the <code>abort</code> method may be called any number of times
|
||
|
to simplify error handling.</p>
|
||
|
|
||
|
<p>WARNING: To guard against memory leaks, the application should
|
||
|
discard all references to the closed handle. While BDB makes an effort
|
||
|
to discard references from closed objects to the allocated memory for an
|
||
|
environment, this behavior is not guaranteed. The safe course of action
|
||
|
for an application is to discard all references to closed BDB
|
||
|
objects.</p></div>
|
||
|
<dl>
|
||
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
||
|
<dd><code><a href="../../../com/sleepycat/je/rep/InsufficientReplicasException.html" title="class in com.sleepycat.je.rep">InsufficientReplicasException</a></code> - if the master
|
||
|
in a replicated environment could not contact enough replicas to
|
||
|
initiate the commit.</dd>
|
||
|
<dd><code><a href="../../../com/sleepycat/je/rep/InsufficientAcksException.html" title="class in com.sleepycat.je.rep">InsufficientAcksException</a></code> - if the master in
|
||
|
a replicated environment did not receive enough replica acknowledgments,
|
||
|
althought the commit succeeded locally.</dd>
|
||
|
<dd><code><a href="../../../com/sleepycat/je/rep/ReplicaWriteException.html" title="class in com.sleepycat.je.rep">ReplicaWriteException</a></code> - if a write operation
|
||
|
was performed with this transaction, but this node is now a Replica.</dd>
|
||
|
<dd><code><a href="../../../com/sleepycat/je/OperationFailureException.html" title="class in com.sleepycat.je">OperationFailureException</a></code> - if this exception occurred earlier and
|
||
|
caused the transaction to be invalidated.</dd>
|
||
|
<dd><code><a href="../../../com/sleepycat/je/EnvironmentFailureException.html" title="class in com.sleepycat.je">EnvironmentFailureException</a></code> - if an unexpected, internal or
|
||
|
environment-wide failure occurs.</dd>
|
||
|
<dd><code>java.lang.IllegalStateException</code> - if the transaction or environment has been
|
||
|
closed, or cursors associated with the transaction are still open.</dd>
|
||
|
<dd><code><a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">DatabaseException</a></code></dd>
|
||
|
</dl>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<a name="commitNoSync--">
|
||
|
<!-- -->
|
||
|
</a>
|
||
|
<ul class="blockList">
|
||
|
<li class="blockList">
|
||
|
<h4>commitNoSync</h4>
|
||
|
<pre>public void commitNoSync()
|
||
|
throws <a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">DatabaseException</a></pre>
|
||
|
<div class="block">End the transaction, not writing to stable storage and not committing
|
||
|
synchronously. 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 this transaction may be undone during recovery.
|
||
|
|
||
|
<p>This behavior may be set for a database environment using the <a href="../../../com/sleepycat/je/EnvironmentMutableConfig.html#setTxnNoSync-boolean-"><code>EnvironmentConfig.setTxnNoSync</code></a> method or for a single transaction using
|
||
|
the <a href="../../../com/sleepycat/je/Environment.html#beginTransaction-com.sleepycat.je.Transaction-com.sleepycat.je.TransactionConfig-"><code>Environment.beginTransaction</code></a> method. Any value specified to this
|
||
|
method overrides both of those settings.</p>
|
||
|
|
||
|
<p>All cursors opened within the transaction must be closed before the
|
||
|
transaction is committed.</p>
|
||
|
|
||
|
<p>If the method encounters an error, the transaction <!-- and all child
|
||
|
transactions of the transaction --> will have been aborted when the call
|
||
|
returns.</p>
|
||
|
|
||
|
<p>After this method has been called, regardless of its return, the
|
||
|
<a href="../../../com/sleepycat/je/Transaction.html" title="class in com.sleepycat.je"><code>Transaction</code></a> handle may not be accessed again, with one
|
||
|
exception: the <code>abort</code> method may be called any number of times
|
||
|
to simplify error handling.</p>
|
||
|
|
||
|
<p>WARNING: To guard against memory leaks, the application should
|
||
|
discard all references to the closed handle. While BDB makes an effort
|
||
|
to discard references from closed objects to the allocated memory for an
|
||
|
environment, this behavior is not guaranteed. The safe course of action
|
||
|
for an application is to discard all references to closed BDB
|
||
|
objects.</p></div>
|
||
|
<dl>
|
||
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
||
|
<dd><code><a href="../../../com/sleepycat/je/rep/InsufficientReplicasException.html" title="class in com.sleepycat.je.rep">InsufficientReplicasException</a></code> - if the master
|
||
|
in a replicated environment could not contact enough replicas to
|
||
|
initiate the commit.</dd>
|
||
|
<dd><code><a href="../../../com/sleepycat/je/rep/InsufficientAcksException.html" title="class in com.sleepycat.je.rep">InsufficientAcksException</a></code> - if the master in
|
||
|
a replicated environment did not receive enough replica acknowledgments,
|
||
|
althought the commit succeeded locally.</dd>
|
||
|
<dd><code><a href="../../../com/sleepycat/je/rep/ReplicaWriteException.html" title="class in com.sleepycat.je.rep">ReplicaWriteException</a></code> - if a write operation
|
||
|
was performed with this transaction, but this node is now a Replica.</dd>
|
||
|
<dd><code><a href="../../../com/sleepycat/je/OperationFailureException.html" title="class in com.sleepycat.je">OperationFailureException</a></code> - if this exception occurred earlier and
|
||
|
caused the transaction to be invalidated.</dd>
|
||
|
<dd><code><a href="../../../com/sleepycat/je/EnvironmentFailureException.html" title="class in com.sleepycat.je">EnvironmentFailureException</a></code> - if an unexpected, internal or
|
||
|
environment-wide failure occurs.</dd>
|
||
|
<dd><code>java.lang.IllegalStateException</code> - if the transaction or environment has been
|
||
|
closed, or cursors associated with the transaction are still open.</dd>
|
||
|
<dd><code><a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">DatabaseException</a></code></dd>
|
||
|
</dl>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<a name="commitWriteNoSync--">
|
||
|
<!-- -->
|
||
|
</a>
|
||
|
<ul class="blockList">
|
||
|
<li class="blockList">
|
||
|
<h4>commitWriteNoSync</h4>
|
||
|
<pre>public void commitWriteNoSync()
|
||
|
throws <a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">DatabaseException</a></pre>
|
||
|
<div class="block">End the transaction, writing to stable storage but not committing
|
||
|
synchronously. 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 this transaction may be undone during recovery.
|
||
|
|
||
|
<p>This behavior is the default for database environments unless
|
||
|
otherwise configured using the <a href="../../../com/sleepycat/je/EnvironmentMutableConfig.html#setTxnNoSync-boolean-"><code>EnvironmentConfig.setTxnNoSync</code></a> method. This behavior may also be set
|
||
|
for a single transaction using the <a href="../../../com/sleepycat/je/Environment.html#beginTransaction-com.sleepycat.je.Transaction-com.sleepycat.je.TransactionConfig-"><code>Environment.beginTransaction</code></a> method. Any value specified to this
|
||
|
method overrides both of those settings.</p>
|
||
|
|
||
|
<p>All cursors opened within the transaction must be closed before the
|
||
|
transaction is committed.</p>
|
||
|
|
||
|
<p>If the method encounters an error, the transaction <!-- and all child
|
||
|
transactions of the transaction --> will have been aborted when the call
|
||
|
returns.</p>
|
||
|
|
||
|
<p>After this method has been called, regardless of its return, the
|
||
|
<a href="../../../com/sleepycat/je/Transaction.html" title="class in com.sleepycat.je"><code>Transaction</code></a> handle may not be accessed again, with one
|
||
|
exception: the <code>abort</code> method may be called any number of times
|
||
|
to simplify error handling.</p>
|
||
|
|
||
|
<p>WARNING: To guard against memory leaks, the application should
|
||
|
discard all references to the closed handle. While BDB makes an effort
|
||
|
to discard references from closed objects to the allocated memory for an
|
||
|
environment, this behavior is not guaranteed. The safe course of action
|
||
|
for an application is to discard all references to closed BDB
|
||
|
objects.</p></div>
|
||
|
<dl>
|
||
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
||
|
<dd><code><a href="../../../com/sleepycat/je/rep/InsufficientReplicasException.html" title="class in com.sleepycat.je.rep">InsufficientReplicasException</a></code> - if the master
|
||
|
in a replicated environment could not contact enough replicas to
|
||
|
initiate the commit.</dd>
|
||
|
<dd><code><a href="../../../com/sleepycat/je/rep/InsufficientAcksException.html" title="class in com.sleepycat.je.rep">InsufficientAcksException</a></code> - if the master in
|
||
|
a replicated environment did not receive enough replica acknowledgments,
|
||
|
althought the commit succeeded locally.</dd>
|
||
|
<dd><code><a href="../../../com/sleepycat/je/rep/ReplicaWriteException.html" title="class in com.sleepycat.je.rep">ReplicaWriteException</a></code> - if a write operation
|
||
|
was performed with this transaction, but this node is now a Replica.</dd>
|
||
|
<dd><code><a href="../../../com/sleepycat/je/OperationFailureException.html" title="class in com.sleepycat.je">OperationFailureException</a></code> - if this exception occurred earlier and
|
||
|
caused the transaction to be invalidated.</dd>
|
||
|
<dd><code><a href="../../../com/sleepycat/je/EnvironmentFailureException.html" title="class in com.sleepycat.je">EnvironmentFailureException</a></code> - if an unexpected, internal or
|
||
|
environment-wide failure occurs.</dd>
|
||
|
<dd><code>java.lang.IllegalStateException</code> - if the transaction or environment has been
|
||
|
closed, or cursors associated with the transaction are still open.</dd>
|
||
|
<dd><code><a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">DatabaseException</a></code></dd>
|
||
|
</dl>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<a name="getTxnTimeout-java.util.concurrent.TimeUnit-">
|
||
|
<!-- -->
|
||
|
</a>
|
||
|
<ul class="blockList">
|
||
|
<li class="blockList">
|
||
|
<h4>getTxnTimeout</h4>
|
||
|
<pre>public long getTxnTimeout(java.util.concurrent.TimeUnit unit)
|
||
|
throws <a href="../../../com/sleepycat/je/EnvironmentFailureException.html" title="class in com.sleepycat.je">EnvironmentFailureException</a>,
|
||
|
java.lang.IllegalStateException,
|
||
|
java.lang.IllegalArgumentException</pre>
|
||
|
<div class="block">Returns the timeout value for the transaction lifetime.
|
||
|
|
||
|
<p>If <a href="../../../com/sleepycat/je/Transaction.html#setTxnTimeout-long-java.util.concurrent.TimeUnit-"><code>setTxnTimeout(long,TimeUnit)</code></a> has not been called to
|
||
|
configure the timeout, the environment configuration value (<a href="../../../com/sleepycat/je/EnvironmentConfig.html#TXN_TIMEOUT"><code>EnvironmentConfig.TXN_TIMEOUT</code></a> )is returned.</p></div>
|
||
|
<dl>
|
||
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
||
|
<dd><code>unit</code> - the <code>TimeUnit</code> of the returned value. May not be null.</dd>
|
||
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
||
|
<dd><code><a href="../../../com/sleepycat/je/EnvironmentFailureException.html" title="class in com.sleepycat.je">EnvironmentFailureException</a></code> - if an unexpected, internal or
|
||
|
environment-wide failure occurs.</dd>
|
||
|
<dd><code>java.lang.IllegalStateException</code> - if the transaction or environment has been
|
||
|
closed.</dd>
|
||
|
<dd><code>java.lang.IllegalArgumentException</code> - if the unit is null.</dd>
|
||
|
<dt><span class="simpleTagLabel">Since:</span></dt>
|
||
|
<dd>4.0</dd>
|
||
|
</dl>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<a name="setTxnTimeout-long-java.util.concurrent.TimeUnit-">
|
||
|
<!-- -->
|
||
|
</a>
|
||
|
<ul class="blockList">
|
||
|
<li class="blockList">
|
||
|
<h4>setTxnTimeout</h4>
|
||
|
<pre>public void setTxnTimeout(long timeOut,
|
||
|
java.util.concurrent.TimeUnit unit)
|
||
|
throws java.lang.IllegalArgumentException,
|
||
|
<a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">DatabaseException</a></pre>
|
||
|
<div class="block">Configures the timeout value for the transaction lifetime.
|
||
|
|
||
|
<p>If the transaction runs longer than this time, an operation using the
|
||
|
transaction may throw <a href="../../../com/sleepycat/je/TransactionTimeoutException.html" title="class in com.sleepycat.je"><code>TransactionTimeoutException</code></a>. The
|
||
|
transaction timeout is checked when locking a record, as part of a read
|
||
|
or write operation.</p>
|
||
|
|
||
|
<p>A value of zero (which is the default) disables timeouts for the
|
||
|
transaction, meaning that no limit on the duration of the transaction is
|
||
|
enforced. Note that the <a href="../../../com/sleepycat/je/Transaction.html#setLockTimeout-long-java.util.concurrent.TimeUnit-"><code>setLockTimeout(long, TimeUnit)</code></a> lock
|
||
|
timeout} is independent of the transaction timeout, and the lock timeout
|
||
|
should not normally be set to zero.</p></div>
|
||
|
<dl>
|
||
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
||
|
<dd><code>timeOut</code> - The timeout value for the transaction lifetime, or zero
|
||
|
to disable transaction timeouts.</dd>
|
||
|
<dd><code>unit</code> - the <code>TimeUnit</code> of the timeOut value. May be null only
|
||
|
if timeOut is zero.</dd>
|
||
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
||
|
<dd><code><a href="../../../com/sleepycat/je/EnvironmentFailureException.html" title="class in com.sleepycat.je">EnvironmentFailureException</a></code> - if an unexpected, internal or
|
||
|
environment-wide failure occurs.</dd>
|
||
|
<dd><code>java.lang.IllegalStateException</code> - if the transaction or environment has been
|
||
|
closed.</dd>
|
||
|
<dd><code>java.lang.IllegalArgumentException</code> - if timeOut or unit is invalid.</dd>
|
||
|
<dd><code><a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">DatabaseException</a></code></dd>
|
||
|
<dt><span class="simpleTagLabel">Since:</span></dt>
|
||
|
<dd>4.0</dd>
|
||
|
</dl>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<a name="setTxnTimeout-long-">
|
||
|
<!-- -->
|
||
|
</a>
|
||
|
<ul class="blockList">
|
||
|
<li class="blockList">
|
||
|
<h4>setTxnTimeout</h4>
|
||
|
<pre>public void setTxnTimeout(long timeOut)
|
||
|
throws java.lang.IllegalArgumentException,
|
||
|
<a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">DatabaseException</a></pre>
|
||
|
<div class="block"><span class="deprecatedLabel">Deprecated.</span> <span class="deprecationComment">as of 4.0, replaced by <a href="../../../com/sleepycat/je/Transaction.html#setTxnTimeout-long-java.util.concurrent.TimeUnit-"><code>setTxnTimeout(long,
|
||
|
TimeUnit)</code></a>.</span></div>
|
||
|
<div class="block">Configures the timeout value for the transaction lifetime, with the
|
||
|
timeout value specified in microseconds. This method is equivalent to:
|
||
|
|
||
|
<pre>setTxnTimeout(long, TimeUnit.MICROSECONDS);</pre></div>
|
||
|
<dl>
|
||
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
||
|
<dd><code>java.lang.IllegalArgumentException</code></dd>
|
||
|
<dd><code><a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">DatabaseException</a></code></dd>
|
||
|
</dl>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<a name="getLockTimeout-java.util.concurrent.TimeUnit-">
|
||
|
<!-- -->
|
||
|
</a>
|
||
|
<ul class="blockList">
|
||
|
<li class="blockList">
|
||
|
<h4>getLockTimeout</h4>
|
||
|
<pre>public long getLockTimeout(java.util.concurrent.TimeUnit unit)
|
||
|
throws <a href="../../../com/sleepycat/je/EnvironmentFailureException.html" title="class in com.sleepycat.je">EnvironmentFailureException</a>,
|
||
|
java.lang.IllegalStateException,
|
||
|
java.lang.IllegalArgumentException</pre>
|
||
|
<div class="block">Returns the lock request timeout value for the transaction.
|
||
|
|
||
|
<p>If <a href="../../../com/sleepycat/je/Transaction.html#setLockTimeout-long-java.util.concurrent.TimeUnit-"><code>setLockTimeout(long,TimeUnit)</code></a> has not been called to
|
||
|
configure the timeout, the environment configuration value (<a href="../../../com/sleepycat/je/EnvironmentConfig.html#LOCK_TIMEOUT"><code>EnvironmentConfig.LOCK_TIMEOUT</code></a>) is returned.</p></div>
|
||
|
<dl>
|
||
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
||
|
<dd><code>unit</code> - the <code>TimeUnit</code> of the returned value. May not be null.</dd>
|
||
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
||
|
<dd><code><a href="../../../com/sleepycat/je/EnvironmentFailureException.html" title="class in com.sleepycat.je">EnvironmentFailureException</a></code> - if an unexpected, internal or
|
||
|
environment-wide failure occurs.</dd>
|
||
|
<dd><code>java.lang.IllegalStateException</code> - if the transaction or environment has been
|
||
|
closed.</dd>
|
||
|
<dd><code>java.lang.IllegalArgumentException</code> - if the unit is null.</dd>
|
||
|
<dt><span class="simpleTagLabel">Since:</span></dt>
|
||
|
<dd>4.0</dd>
|
||
|
</dl>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<a name="setLockTimeout-long-java.util.concurrent.TimeUnit-">
|
||
|
<!-- -->
|
||
|
</a>
|
||
|
<ul class="blockList">
|
||
|
<li class="blockList">
|
||
|
<h4>setLockTimeout</h4>
|
||
|
<pre>public void setLockTimeout(long timeOut,
|
||
|
java.util.concurrent.TimeUnit unit)
|
||
|
throws java.lang.IllegalArgumentException,
|
||
|
<a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">DatabaseException</a></pre>
|
||
|
<div class="block">Configures the lock request timeout value for the transaction. This
|
||
|
overrides the <a href="../../../com/sleepycat/je/EnvironmentConfig.html#setLockTimeout-long-java.util.concurrent.TimeUnit-"><code>default lock timeout</code></a>.
|
||
|
|
||
|
<p>A value of zero disables lock timeouts. This is not recommended, even
|
||
|
when the application expects that deadlocks will not occur or will be
|
||
|
easily resolved. A lock timeout is a fall-back that guards against
|
||
|
unexpected "live lock", unresponsive threads, or application failure to
|
||
|
close a cursor or to commit or abort a transaction.</p></div>
|
||
|
<dl>
|
||
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
||
|
<dd><code>timeOut</code> - The lock timeout for all transactional and
|
||
|
non-transactional operations, or zero to disable lock timeouts.</dd>
|
||
|
<dd><code>unit</code> - the <code>TimeUnit</code> of the timeOut value. May be null only
|
||
|
if timeOut is zero.</dd>
|
||
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
||
|
<dd><code><a href="../../../com/sleepycat/je/EnvironmentFailureException.html" title="class in com.sleepycat.je">EnvironmentFailureException</a></code> - if an unexpected, internal or
|
||
|
environment-wide failure occurs.</dd>
|
||
|
<dd><code>java.lang.IllegalStateException</code> - if the transaction or environment has been
|
||
|
closed.</dd>
|
||
|
<dd><code>java.lang.IllegalArgumentException</code> - if timeOut or unit is invalid.</dd>
|
||
|
<dd><code><a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">DatabaseException</a></code></dd>
|
||
|
<dt><span class="simpleTagLabel">Since:</span></dt>
|
||
|
<dd>4.0</dd>
|
||
|
</dl>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<a name="setLockTimeout-long-">
|
||
|
<!-- -->
|
||
|
</a>
|
||
|
<ul class="blockList">
|
||
|
<li class="blockList">
|
||
|
<h4>setLockTimeout</h4>
|
||
|
<pre>public void setLockTimeout(long timeOut)
|
||
|
throws java.lang.IllegalArgumentException,
|
||
|
<a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">DatabaseException</a></pre>
|
||
|
<div class="block"><span class="deprecatedLabel">Deprecated.</span> <span class="deprecationComment">as of 4.0, replaced by <a href="../../../com/sleepycat/je/Transaction.html#setLockTimeout-long-java.util.concurrent.TimeUnit-"><code>setLockTimeout(long,
|
||
|
TimeUnit)</code></a>.</span></div>
|
||
|
<div class="block">Configures the lock request timeout value for the transaction, with the
|
||
|
timeout value specified in microseconds. This method is equivalent to:
|
||
|
|
||
|
<pre>setLockTimeout(long, TimeUnit.MICROSECONDS);</pre></div>
|
||
|
<dl>
|
||
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
||
|
<dd><code>java.lang.IllegalArgumentException</code></dd>
|
||
|
<dd><code><a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">DatabaseException</a></code></dd>
|
||
|
</dl>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<a name="setName-java.lang.String-">
|
||
|
<!-- -->
|
||
|
</a>
|
||
|
<ul class="blockList">
|
||
|
<li class="blockList">
|
||
|
<h4>setName</h4>
|
||
|
<pre>public void setName(java.lang.String name)</pre>
|
||
|
<div class="block">Set the user visible name for the transaction.</div>
|
||
|
<dl>
|
||
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
||
|
<dd><code>name</code> - The user visible name for the transaction.</dd>
|
||
|
</dl>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<a name="getName--">
|
||
|
<!-- -->
|
||
|
</a>
|
||
|
<ul class="blockList">
|
||
|
<li class="blockList">
|
||
|
<h4>getName</h4>
|
||
|
<pre>public java.lang.String getName()</pre>
|
||
|
<div class="block">Get the user visible name for the transaction.</div>
|
||
|
<dl>
|
||
|
<dt><span class="returnLabel">Returns:</span></dt>
|
||
|
<dd>The user visible name for the transaction.</dd>
|
||
|
</dl>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<a name="toString--">
|
||
|
<!-- -->
|
||
|
</a>
|
||
|
<ul class="blockList">
|
||
|
<li class="blockList">
|
||
|
<h4>toString</h4>
|
||
|
<pre>public java.lang.String toString()</pre>
|
||
|
<dl>
|
||
|
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
|
||
|
<dd><code>toString</code> in class <code>java.lang.Object</code></dd>
|
||
|
</dl>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<a name="isValid--">
|
||
|
<!-- -->
|
||
|
</a>
|
||
|
<ul class="blockList">
|
||
|
<li class="blockList">
|
||
|
<h4>isValid</h4>
|
||
|
<pre>public boolean isValid()</pre>
|
||
|
<div class="block">Returns whether this <code>Transaction</code> is open, which is equivalent
|
||
|
to when <a href="../../../com/sleepycat/je/Transaction.html#getState--"><code>getState()</code></a> returns <a href="../../../com/sleepycat/je/Transaction.State.html#OPEN"><code>Transaction.State.OPEN</code></a>. See <a href="../../../com/sleepycat/je/Transaction.State.html#OPEN"><code>Transaction.State.OPEN</code></a> for more
|
||
|
information.
|
||
|
|
||
|
<p>When an <a href="../../../com/sleepycat/je/OperationFailureException.html" title="class in com.sleepycat.je"><code>OperationFailureException</code></a>, or one of its subclasses,
|
||
|
is caught, the <code>isValid</code> method may be called to determine whether
|
||
|
the <code>Transaction</code> can continue to be used, or should be
|
||
|
aborted.</p></div>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<a name="getState--">
|
||
|
<!-- -->
|
||
|
</a>
|
||
|
<ul class="blockListLast">
|
||
|
<li class="blockList">
|
||
|
<h4>getState</h4>
|
||
|
<pre>public <a href="../../../com/sleepycat/je/Transaction.State.html" title="enum in com.sleepycat.je">Transaction.State</a> getState()</pre>
|
||
|
<div class="block">Returns the current state of the transaction.</div>
|
||
|
<dl>
|
||
|
<dt><span class="simpleTagLabel">Since:</span></dt>
|
||
|
<dd>5.0.48</dd>
|
||
|
</dl>
|
||
|
</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
</div>
|
||
|
<!-- ========= END OF CLASS DATA ========= -->
|
||
|
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
||
|
<div class="bottomNav"><a name="navbar.bottom">
|
||
|
<!-- -->
|
||
|
</a>
|
||
|
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
|
||
|
<a name="navbar.bottom.firstrow">
|
||
|
<!-- -->
|
||
|
</a>
|
||
|
<ul class="navList" title="Navigation">
|
||
|
<li><a href="../../../overview-summary.html">Overview</a></li>
|
||
|
<li><a href="package-summary.html">Package</a></li>
|
||
|
<li class="navBarCell1Rev">Class</li>
|
||
|
<li><a href="class-use/Transaction.html">Use</a></li>
|
||
|
<li><a href="package-tree.html">Tree</a></li>
|
||
|
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
|
||
|
<li><a href="../../../index-all.html">Index</a></li>
|
||
|
<li><a href="../../../help-doc.html">Help</a></li>
|
||
|
</ul>
|
||
|
<div class="aboutLanguage"><b>Berkeley DB Java Edition</b><br><font size=\"-1\"> version 7.5.11</font>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="subNav">
|
||
|
<ul class="navList">
|
||
|
<li><a href="../../../com/sleepycat/je/ThreadInterruptedException.html" title="class in com.sleepycat.je"><span class="typeNameLink">Prev Class</span></a></li>
|
||
|
<li><a href="../../../com/sleepycat/je/Transaction.State.html" title="enum in com.sleepycat.je"><span class="typeNameLink">Next Class</span></a></li>
|
||
|
</ul>
|
||
|
<ul class="navList">
|
||
|
<li><a href="../../../index.html?com/sleepycat/je/Transaction.html" target="_top">Frames</a></li>
|
||
|
<li><a href="Transaction.html" target="_top">No Frames</a></li>
|
||
|
</ul>
|
||
|
<ul class="navList" id="allclasses_navbar_bottom">
|
||
|
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
|
||
|
</ul>
|
||
|
<div>
|
||
|
<script type="text/javascript"><!--
|
||
|
allClassesLink = document.getElementById("allclasses_navbar_bottom");
|
||
|
if(window==top) {
|
||
|
allClassesLink.style.display = "block";
|
||
|
}
|
||
|
else {
|
||
|
allClassesLink.style.display = "none";
|
||
|
}
|
||
|
//-->
|
||
|
</script>
|
||
|
</div>
|
||
|
<div>
|
||
|
<ul class="subNavList">
|
||
|
<li>Summary: </li>
|
||
|
<li><a href="#nested.class.summary">Nested</a> | </li>
|
||
|
<li>Field | </li>
|
||
|
<li>Constr | </li>
|
||
|
<li><a href="#method.summary">Method</a></li>
|
||
|
</ul>
|
||
|
<ul class="subNavList">
|
||
|
<li>Detail: </li>
|
||
|
<li>Field | </li>
|
||
|
<li>Constr | </li>
|
||
|
<li><a href="#method.detail">Method</a></li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<a name="skip.navbar.bottom">
|
||
|
<!-- -->
|
||
|
</a></div>
|
||
|
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
||
|
<p class="legalCopy"><small><font size=1>Copyright (c) 2002, 2017 Oracle and/or its affiliates. All rights reserved.</font> </small></p>
|
||
|
</body>
|
||
|
</html>
|