blob: bfbc2950040166a23f1a203028a922efa9f56bd3 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<link rel="canonical" href="https://ignite.apache.org/releases/2.7.6/javadoc/org/apache/ignite/transactions/Transaction.html" />
<META NAME="ROBOTS" CONTENT="NOINDEX">
<!-- Generated by javadoc (1.8.0_212) on Wed Sep 11 22:29:48 MSK 2019 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Transaction (Ignite 2.7.6)</title>
<meta name="date" content="2019-09-11">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
<link rel='shortcut icon' href='https://ignite.apache.org/favicon.ico'/>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-61232409-1', 'auto');
ga('send', 'pageview');
</script></head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Transaction (Ignite 2.7.6)";
}
}
catch(err) {
}
//-->
var methods = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6,"i7":6,"i8":6,"i9":6,"i10":6,"i11":6,"i12":6,"i13":6,"i14":6,"i15":6,"i16":6,"i17":6,"i18":6,"i19":6,"i20":6};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract 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>
<div class="subNav">
<ul class="navList">
<li>Prev&nbsp;Class</li>
<li><a href="../../../../org/apache/ignite/transactions/TransactionConcurrency.html" title="enum in org.apache.ignite.transactions"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/ignite/transactions/Transaction.html" target="_top">Frames</a></li>
<li><a href="Transaction.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;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:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</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">org.apache.ignite.transactions</div>
<h2 title="Interface Transaction" class="title">Interface Transaction</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Superinterfaces:</dt>
<dd><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html?is-external=true" title="class or interface in java.lang">AutoCloseable</a>, <a href="../../../../org/apache/ignite/lang/IgniteAsyncSupport.html" title="interface in org.apache.ignite.lang">IgniteAsyncSupport</a></dd>
</dl>
<hr>
<br>
<pre>public interface <span class="typeNameLabel">Transaction</span>
extends <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html?is-external=true" title="class or interface in java.lang">AutoCloseable</a>, <a href="../../../../org/apache/ignite/lang/IgniteAsyncSupport.html" title="interface in org.apache.ignite.lang">IgniteAsyncSupport</a></pre>
<div class="block">Ignite cache transaction. Cache transactions have a default 2PC (two-phase-commit) behavior and
can be plugged into ongoing <code>JTA</code> transaction by properly implementing
<a href="../../../../org/apache/ignite/cache/jta/CacheTmLookup.html"><code>CacheTmLookup</code></a>
interface. Cache transactions can also be started explicitly directly from <a href="../../../../org/apache/ignite/IgniteTransactions.html" title="interface in org.apache.ignite"><code>IgniteTransactions</code></a> API
via any of the <code>'IgniteTransactions.txStart(..)'</code> methods.
<p>
Cache transactions support the following isolation levels:
<ul>
<li>
<a href="../../../../org/apache/ignite/transactions/TransactionIsolation.html#READ_COMMITTED"><code>TransactionIsolation.READ_COMMITTED</code></a> isolation level means that always a committed value
will be provided for read operations. With this isolation level values are always read
from cache global memory or persistent store every time a value is accessed. In other words,
if the same key is accessed more than once within the same transaction, it may have different
value every time since global cache memory may be updated concurrently by other threads.
</li>
<li>
<a href="../../../../org/apache/ignite/transactions/TransactionIsolation.html#REPEATABLE_READ"><code>TransactionIsolation.REPEATABLE_READ</code></a> isolation level means that if a value was read once
within transaction, then all consecutive reads will provide the same in-transaction value. With
this isolation level accessed values are stored within in-transaction memory, so consecutive access
to the same key within the same transaction will always return the value that was previously read or
updated within this transaction. If concurrency is <a href="../../../../org/apache/ignite/transactions/TransactionConcurrency.html#PESSIMISTIC"><code>TransactionConcurrency.PESSIMISTIC</code></a>, then a lock
on the key will be acquired prior to accessing the value.
</li>
<li>
<a href="../../../../org/apache/ignite/transactions/TransactionIsolation.html#SERIALIZABLE"><code>TransactionIsolation.SERIALIZABLE</code></a> isolation level means that all transactions occur in a completely
isolated fashion, as if all transactions in the system had executed serially, one after the other.
Read access with this level happens the same way as with <a href="../../../../org/apache/ignite/transactions/TransactionIsolation.html#REPEATABLE_READ"><code>TransactionIsolation.REPEATABLE_READ</code></a> level.
However, in <a href="../../../../org/apache/ignite/transactions/TransactionConcurrency.html#OPTIMISTIC"><code>TransactionConcurrency.OPTIMISTIC</code></a> mode, if some transactions cannot be serially isolated
from each other, then one winner will be picked and the other transactions in conflict will result in
<a href="../../../../org/apache/ignite/transactions/TransactionOptimisticException.html" title="class in org.apache.ignite.transactions"><code>TransactionOptimisticException</code></a> being thrown.
</li>
</ul>
<p>
Cache transactions support the following concurrency models:
<ul>
<li>
<a href="../../../../org/apache/ignite/transactions/TransactionConcurrency.html#OPTIMISTIC"><code>TransactionConcurrency.OPTIMISTIC</code></a> - in this mode all cache operations are not distributed to other
nodes until <a href="../../../../org/apache/ignite/transactions/Transaction.html#commit--"><code>commit()</code></a> is called. In this mode one <code>'PREPARE'</code>
message will be sent to participating cache nodes to start acquiring per-transaction locks, and once
all nodes reply <code>'OK'</code> (i.e. <code>Phase 1</code> completes successfully), a one-way' <code>'COMMIT'</code>
message is sent without waiting for reply. If it is necessary to know whenever remote nodes have committed
as well, synchronous commit or synchronous rollback should be enabled via
<a href="../../../../org/apache/ignite/configuration/CacheConfiguration.html#setWriteSynchronizationMode-org.apache.ignite.cache.CacheWriteSynchronizationMode-"><code>CacheConfiguration.setWriteSynchronizationMode(org.apache.ignite.cache.CacheWriteSynchronizationMode)</code></a>.
<p>
Note that in this mode, optimistic failures are only possible in conjunction with
<a href="../../../../org/apache/ignite/transactions/TransactionIsolation.html#SERIALIZABLE"><code>TransactionIsolation.SERIALIZABLE</code></a> isolation level. In all other cases, optimistic
transactions will never fail optimistically and will always be identically ordered on all participating
grid nodes.
</li>
<li>
<a href="../../../../org/apache/ignite/transactions/TransactionConcurrency.html#PESSIMISTIC"><code>TransactionConcurrency.PESSIMISTIC</code></a> - in this mode a lock is acquired on all cache operations
with exception of read operations in <a href="../../../../org/apache/ignite/transactions/TransactionIsolation.html#READ_COMMITTED"><code>TransactionIsolation.READ_COMMITTED</code></a> mode. All optional filters
passed into cache operations will be evaluated after successful lock acquisition. Whenever
<a href="../../../../org/apache/ignite/transactions/Transaction.html#commit--"><code>commit()</code></a> is called, a single one-way <code>'COMMIT'</code> message
is sent to participating cache nodes without waiting for reply. Note that there is no reason for
distributed 'PREPARE' step, as all locks have been already acquired. Just like with optimistic mode,
it is possible to configure synchronous commit or rollback and wait till transaction commits on
all participating remote nodes.
</li>
</ul>
<p>
<h1 class="header">Cache Atomicity Mode</h1>
In addition to standard <a href="../../../../org/apache/ignite/cache/CacheAtomicityMode.html#TRANSACTIONAL"><code>CacheAtomicityMode.TRANSACTIONAL</code></a> behavior, Ignite also supports
a lighter <a href="../../../../org/apache/ignite/cache/CacheAtomicityMode.html#ATOMIC"><code>CacheAtomicityMode.ATOMIC</code></a> mode as well. In this mode distributed transactions
and distributed locking are not supported. Disabling transactions and locking allows to achieve much higher
performance and throughput ratios. It is recommended that <a href="../../../../org/apache/ignite/cache/CacheAtomicityMode.html#ATOMIC"><code>CacheAtomicityMode.ATOMIC</code></a> mode
is used whenever full <code>ACID</code>-compliant transactions are not needed.
<p>
<h1 class="header">Usage</h1>
You can use cache transactions as follows:
<pre name="code" class="java">
Ignite ignite = Ignition.ignite();
IgniteCache&lt;String, Integer&gt; cache = ignite.cache(cacheName);
try (Transaction tx = ignite.transactions().txStart()) {
// Perform transactional operations.
Integer v1 = cache.get("k1");
// Check if v1 satisfies some condition before doing a put.
if (v1 != null && v1 > 0)
cache.put("k1", 2);
cache.remove("k2");
// Commit the transaction.
tx.commit();
}
</pre></div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== 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">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</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="../../../../org/apache/ignite/transactions/Transaction.html#close--">close</a></span>()</code>
<div class="block">Ends 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="../../../../org/apache/ignite/transactions/Transaction.html#commit--">commit</a></span>()</code>
<div class="block">Commits this transaction by initiating <code>two-phase-commit</code> process.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code><a href="../../../../org/apache/ignite/lang/IgniteFuture.html" title="interface in org.apache.ignite.lang">IgniteFuture</a><span class='angle_bracket'>&lt;</span><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Void.html?is-external=true" title="class or interface in java.lang">Void</a><span class='angle_bracket'>&gt;</span></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/ignite/transactions/Transaction.html#commitAsync--">commitAsync</a></span>()</code>
<div class="block">Asynchronously commits this transaction by initiating <code>two-phase-commit</code> process.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="../../../../org/apache/ignite/transactions/TransactionConcurrency.html" title="enum in org.apache.ignite.transactions">TransactionConcurrency</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/ignite/transactions/Transaction.html#concurrency--">concurrency</a></span>()</code>
<div class="block">Cache transaction concurrency mode.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/ignite/transactions/Transaction.html#implicit--">implicit</a></span>()</code>
<div class="block">Flag indicating whether transaction was started automatically by the
system or not.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/ignite/transactions/Transaction.html#isInvalidate--">isInvalidate</a></span>()</code>
<div class="block">Get invalidation flag for this transaction.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code><a href="../../../../org/apache/ignite/transactions/TransactionIsolation.html" title="enum in org.apache.ignite.transactions">TransactionIsolation</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/ignite/transactions/Transaction.html#isolation--">isolation</a></span>()</code>
<div class="block">Cache transaction isolation level.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/ignite/transactions/Transaction.html#isRollbackOnly--">isRollbackOnly</a></span>()</code>
<div class="block">If transaction was marked as rollback-only.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/ignite/transactions/Transaction.html#label--">label</a></span>()</code>
<div class="block">Returns transaction's label.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/8/docs/api/java/util/UUID.html?is-external=true" title="class or interface in java.util">UUID</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/ignite/transactions/Transaction.html#nodeId--">nodeId</a></span>()</code>
<div class="block">ID of the node on which this transaction started.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/ignite/transactions/Transaction.html#resume--">resume</a></span>()</code>
<div class="block">Resume a transaction if it was previously suspended.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/ignite/transactions/Transaction.html#rollback--">rollback</a></span>()</code>
<div class="block">Rolls back this transaction.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code><a href="../../../../org/apache/ignite/lang/IgniteFuture.html" title="interface in org.apache.ignite.lang">IgniteFuture</a><span class='angle_bracket'>&lt;</span><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Void.html?is-external=true" title="class or interface in java.lang">Void</a><span class='angle_bracket'>&gt;</span></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/ignite/transactions/Transaction.html#rollbackAsync--">rollbackAsync</a></span>()</code>
<div class="block">Asynchronously rolls back this transaction.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/ignite/transactions/Transaction.html#setRollbackOnly--">setRollbackOnly</a></span>()</code>
<div class="block">Modify the transaction associated with the current thread such that the
only possible outcome of the transaction is to roll back the
transaction.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/ignite/transactions/Transaction.html#startTime--">startTime</a></span>()</code>
<div class="block">Start time of this transaction.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code><a href="../../../../org/apache/ignite/transactions/TransactionState.html" title="enum in org.apache.ignite.transactions">TransactionState</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/ignite/transactions/Transaction.html#state--">state</a></span>()</code>
<div class="block">Gets current transaction state value.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/ignite/transactions/Transaction.html#suspend--">suspend</a></span>()</code>
<div class="block">Suspends a transaction.</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/ignite/transactions/Transaction.html#threadId--">threadId</a></span>()</code>
<div class="block">ID of the thread in which this transaction started.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/ignite/transactions/Transaction.html#timeout--">timeout</a></span>()</code>
<div class="block">Gets timeout value in milliseconds for this transaction.</div>
</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/ignite/transactions/Transaction.html#timeout-long-">timeout</a></span>(long&nbsp;timeout)</code>
<div class="block">Sets transaction timeout value.</div>
</td>
</tr>
<tr id="i20" class="altColor">
<td class="colFirst"><code><a href="../../../../org/apache/ignite/lang/IgniteUuid.html" title="class in org.apache.ignite.lang">IgniteUuid</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/ignite/transactions/Transaction.html#xid--">xid</a></span>()</code>
<div class="block">Gets unique identifier for this transaction.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.org.apache.ignite.lang.IgniteAsyncSupport">
<!-- -->
</a>
<h3>Methods inherited from interface&nbsp;org.apache.ignite.lang.<a href="../../../../org/apache/ignite/lang/IgniteAsyncSupport.html" title="interface in org.apache.ignite.lang">IgniteAsyncSupport</a></h3>
<code><a href="../../../../org/apache/ignite/lang/IgniteAsyncSupport.html#future--">future</a>, <a href="../../../../org/apache/ignite/lang/IgniteAsyncSupport.html#isAsync--">isAsync</a>, <a href="../../../../org/apache/ignite/lang/IgniteAsyncSupport.html#withAsync--">withAsync</a></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="xid--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>xid</h4>
<pre><a href="../../../../org/apache/ignite/lang/IgniteUuid.html" title="class in org.apache.ignite.lang">IgniteUuid</a>&nbsp;xid()</pre>
<div class="block">Gets unique identifier for this transaction.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Transaction UID.</dd>
</dl>
</li>
</ul>
<a name="nodeId--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>nodeId</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/util/UUID.html?is-external=true" title="class or interface in java.util">UUID</a>&nbsp;nodeId()</pre>
<div class="block">ID of the node on which this transaction started.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Originating node ID.</dd>
</dl>
</li>
</ul>
<a name="threadId--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>threadId</h4>
<pre>long&nbsp;threadId()</pre>
<div class="block">ID of the thread in which this transaction started.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Thread ID.</dd>
</dl>
</li>
</ul>
<a name="startTime--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>startTime</h4>
<pre>long&nbsp;startTime()</pre>
<div class="block">Start time of this transaction.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Start time of this transaction on this node.</dd>
</dl>
</li>
</ul>
<a name="isolation--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isolation</h4>
<pre><a href="../../../../org/apache/ignite/transactions/TransactionIsolation.html" title="enum in org.apache.ignite.transactions">TransactionIsolation</a>&nbsp;isolation()</pre>
<div class="block">Cache transaction isolation level.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Isolation level.</dd>
</dl>
</li>
</ul>
<a name="concurrency--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>concurrency</h4>
<pre><a href="../../../../org/apache/ignite/transactions/TransactionConcurrency.html" title="enum in org.apache.ignite.transactions">TransactionConcurrency</a>&nbsp;concurrency()</pre>
<div class="block">Cache transaction concurrency mode.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Concurrency mode.</dd>
</dl>
</li>
</ul>
<a name="implicit--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>implicit</h4>
<pre>boolean&nbsp;implicit()</pre>
<div class="block">Flag indicating whether transaction was started automatically by the
system or not. System will start transactions implicitly whenever
any cache <code>put(..)</code> or <code>remove(..)</code> operation is invoked
outside of transaction.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><code>True</code> if transaction was started implicitly.</dd>
</dl>
</li>
</ul>
<a name="isInvalidate--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isInvalidate</h4>
<pre>boolean&nbsp;isInvalidate()</pre>
<div class="block">Get invalidation flag for this transaction. If set to <code>true</code>, then
remote values will be <code>invalidated</code> (set to <code>null</code>) instead
of updated.
<p>
Invalidation messages don't carry new values, so they are a lot lighter
than update messages. However, when a value is accessed on a node after
it's been invalidated, it must be loaded from persistent store.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Invalidation flag.</dd>
</dl>
</li>
</ul>
<a name="state--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>state</h4>
<pre><a href="../../../../org/apache/ignite/transactions/TransactionState.html" title="enum in org.apache.ignite.transactions">TransactionState</a>&nbsp;state()</pre>
<div class="block">Gets current transaction state value.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Current transaction state.</dd>
</dl>
</li>
</ul>
<a name="timeout--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>timeout</h4>
<pre>long&nbsp;timeout()</pre>
<div class="block">Gets timeout value in milliseconds for this transaction. If transaction times
out prior to it's completion, <a href="../../../../org/apache/ignite/transactions/TransactionTimeoutException.html" title="class in org.apache.ignite.transactions"><code>TransactionTimeoutException</code></a> will be thrown.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Transaction timeout value.</dd>
</dl>
</li>
</ul>
<a name="timeout-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>timeout</h4>
<pre>long&nbsp;timeout(long&nbsp;timeout)</pre>
<div class="block">Sets transaction timeout value. This value can be set only before a first operation
on transaction has been performed.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>timeout</code> - Transaction timeout value.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Previous timeout.</dd>
</dl>
</li>
</ul>
<a name="setRollbackOnly--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setRollbackOnly</h4>
<pre>boolean&nbsp;setRollbackOnly()</pre>
<div class="block">Modify the transaction associated with the current thread such that the
only possible outcome of the transaction is to roll back the
transaction.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><code>True</code> if rollback-only flag was set as a result of this operation,
<code>false</code> if it was already set prior to this call or could not be set
because transaction is already finishing up committing or rolling back.</dd>
</dl>
</li>
</ul>
<a name="isRollbackOnly--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isRollbackOnly</h4>
<pre>boolean&nbsp;isRollbackOnly()</pre>
<div class="block">If transaction was marked as rollback-only.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><code>True</code> if transaction can only be rolled back.</dd>
</dl>
</li>
</ul>
<a name="commit--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>commit</h4>
<pre><a href="../../../../org/apache/ignite/lang/IgniteAsyncSupported.html" title="annotation in org.apache.ignite.lang">@IgniteAsyncSupported</a>
void&nbsp;commit()
throws <a href="../../../../org/apache/ignite/IgniteException.html" title="class in org.apache.ignite">IgniteException</a></pre>
<div class="block">Commits this transaction by initiating <code>two-phase-commit</code> process.</div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/ignite/IgniteException.html" title="class in org.apache.ignite">IgniteException</a></code> - If commit failed.</dd>
<dd><code><a href="../../../../org/apache/ignite/transactions/TransactionTimeoutException.html" title="class in org.apache.ignite.transactions">TransactionTimeoutException</a></code> - If transaction is timed out.</dd>
<dd><code><a href="../../../../org/apache/ignite/transactions/TransactionRollbackException.html" title="class in org.apache.ignite.transactions">TransactionRollbackException</a></code> - If transaction is automatically rolled back.</dd>
<dd><code><a href="../../../../org/apache/ignite/transactions/TransactionOptimisticException.html" title="class in org.apache.ignite.transactions">TransactionOptimisticException</a></code> - If transaction concurrency is <a href="../../../../org/apache/ignite/transactions/TransactionConcurrency.html#OPTIMISTIC"><code>TransactionConcurrency.OPTIMISTIC</code></a>
and commit is optimistically failed.</dd>
<dd><code><a href="../../../../org/apache/ignite/transactions/TransactionHeuristicException.html" title="class in org.apache.ignite.transactions">TransactionHeuristicException</a></code> - If transaction has entered an unknown state.</dd>
</dl>
</li>
</ul>
<a name="commitAsync--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>commitAsync</h4>
<pre><a href="../../../../org/apache/ignite/lang/IgniteFuture.html" title="interface in org.apache.ignite.lang">IgniteFuture</a><span class='angle_bracket'>&lt;</span><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Void.html?is-external=true" title="class or interface in java.lang">Void</a><span class='angle_bracket'>&gt;</span>&nbsp;commitAsync()
throws <a href="../../../../org/apache/ignite/IgniteException.html" title="class in org.apache.ignite">IgniteException</a></pre>
<div class="block">Asynchronously commits this transaction by initiating <code>two-phase-commit</code> process.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a Future representing pending completion of the commit.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/ignite/IgniteException.html" title="class in org.apache.ignite">IgniteException</a></code> - If commit failed.</dd>
<dd><code><a href="../../../../org/apache/ignite/transactions/TransactionTimeoutException.html" title="class in org.apache.ignite.transactions">TransactionTimeoutException</a></code> - If transaction is timed out.</dd>
<dd><code><a href="../../../../org/apache/ignite/transactions/TransactionRollbackException.html" title="class in org.apache.ignite.transactions">TransactionRollbackException</a></code> - If transaction is manually/automatically rolled back.</dd>
<dd><code><a href="../../../../org/apache/ignite/transactions/TransactionOptimisticException.html" title="class in org.apache.ignite.transactions">TransactionOptimisticException</a></code> - If transaction concurrency is <a href="../../../../org/apache/ignite/transactions/TransactionConcurrency.html#OPTIMISTIC"><code>TransactionConcurrency.OPTIMISTIC</code></a>
and commit is optimistically failed.</dd>
<dd><code><a href="../../../../org/apache/ignite/transactions/TransactionHeuristicException.html" title="class in org.apache.ignite.transactions">TransactionHeuristicException</a></code> - If transaction has entered an unknown state.</dd>
</dl>
</li>
</ul>
<a name="close--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>close</h4>
<pre>void&nbsp;close()
throws <a href="../../../../org/apache/ignite/IgniteException.html" title="class in org.apache.ignite">IgniteException</a></pre>
<div class="block">Ends the transaction. Transaction will be rolled back if it has not been committed.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html?is-external=true#close--" title="class or interface in java.lang">close</a></code>&nbsp;in interface&nbsp;<code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html?is-external=true" title="class or interface in java.lang">AutoCloseable</a></code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/ignite/IgniteException.html" title="class in org.apache.ignite">IgniteException</a></code> - If transaction could not be gracefully ended.</dd>
</dl>
</li>
</ul>
<a name="rollback--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>rollback</h4>
<pre><a href="../../../../org/apache/ignite/lang/IgniteAsyncSupported.html" title="annotation in org.apache.ignite.lang">@IgniteAsyncSupported</a>
void&nbsp;rollback()
throws <a href="../../../../org/apache/ignite/IgniteException.html" title="class in org.apache.ignite">IgniteException</a></pre>
<div class="block">Rolls back this transaction.
Note, that it's allowed to roll back transaction from any thread at any time.</div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/ignite/IgniteException.html" title="class in org.apache.ignite">IgniteException</a></code> - If rollback failed.</dd>
</dl>
</li>
</ul>
<a name="rollbackAsync--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>rollbackAsync</h4>
<pre><a href="../../../../org/apache/ignite/lang/IgniteFuture.html" title="interface in org.apache.ignite.lang">IgniteFuture</a><span class='angle_bracket'>&lt;</span><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Void.html?is-external=true" title="class or interface in java.lang">Void</a><span class='angle_bracket'>&gt;</span>&nbsp;rollbackAsync()
throws <a href="../../../../org/apache/ignite/IgniteException.html" title="class in org.apache.ignite">IgniteException</a></pre>
<div class="block">Asynchronously rolls back this transaction.
Note, that it's allowed to roll back transaction from any thread at any time.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a Future representing pending completion of the rollback.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/ignite/IgniteException.html" title="class in org.apache.ignite">IgniteException</a></code> - If rollback failed.</dd>
</dl>
</li>
</ul>
<a name="resume--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>resume</h4>
<pre>void&nbsp;resume()
throws <a href="../../../../org/apache/ignite/IgniteException.html" title="class in org.apache.ignite">IgniteException</a></pre>
<div class="block">Resume a transaction if it was previously suspended. <strong>Supported only for optimistic transactions.</strong></div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/ignite/IgniteException.html" title="class in org.apache.ignite">IgniteException</a></code> - If resume failed.</dd>
</dl>
</li>
</ul>
<a name="suspend--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>suspend</h4>
<pre>void&nbsp;suspend()
throws <a href="../../../../org/apache/ignite/IgniteException.html" title="class in org.apache.ignite">IgniteException</a></pre>
<div class="block">Suspends a transaction. It could be resumed later. <strong>Supported only for optimistic transactions.</strong></div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/ignite/IgniteException.html" title="class in org.apache.ignite">IgniteException</a></code> - If suspension failed.</dd>
</dl>
</li>
</ul>
<a name="label--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>label</h4>
<pre>@Nullable
<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;label()</pre>
<div class="block">Returns transaction's label.
<p>
Use <a href="../../../../org/apache/ignite/IgniteTransactions.html#withLabel-java.lang.String-"><code>IgniteTransactions.withLabel(java.lang.String)</code></a> to assign a label to a newly created transaction.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Label.</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>
<div class="subNav">
<ul class="navList">
<li>Prev&nbsp;Class</li>
<li><a href="../../../../org/apache/ignite/transactions/TransactionConcurrency.html" title="enum in org.apache.ignite.transactions"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/ignite/transactions/Transaction.html" target="_top">Frames</a></li>
<li><a href="Transaction.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;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:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</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><table width="100%" border="0" cellspacing=0 cellpadding=0 style="padding: 5px"> <tr> <td> <table style="padding-left: 0; margin: 0"> <tbody style="padding: 0; margin: 0"> <tr style="padding: 0; margin: 0"> <td> <a target=_blank href="https://ignite.apache.org"><nobr>2019 Copyright &#169; Apache Software Foundation</nobr></a> </td> </tr> </tbody> </table> </td> <td width="100%" align="right" valign="center"> <a href="https://twitter.com/ApacheIgnite" class="twitter-follow-button" data-show-count="false" data-size="large">Follow @ApacheIgnite</a> </td> </tr> <tr> <td colspan="2" valign="top" align="left"> <table style="padding-left: 0; margin: 0"> <tbody style="padding: 0; margin: 0"> <tr style="padding: 0; margin: 0"> <td> <b>Ignite Database and Caching Platform</b> </td> <td>:&nbsp;&nbsp; ver. <strong>2.7.6</strong> </td> </tr> <tr style="padding: 0; margin: 0"> <td> <b>Release Date</b> </td> <td>:&nbsp;&nbsp; September 11 2019 </td> </tr> </tbody> </table> </td> </tr> </table></small></p>
</body>
</html>