<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0-google-v4) on Fri Oct 07 18:14:58 PDT 2011 -->
<TITLE>
Transaction
</TITLE>

<META NAME="date" CONTENT="2011-10-07">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../dev_javadoc.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="Transaction";
    }
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">
<HR>


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../com/google/appengine/api/datastore/Text.html" title="class in com.google.appengine.api.datastore"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../com/google/appengine/api/datastore/TransactionOptions.html" title="class in com.google.appengine.api.datastore"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../index.html?com/google/appengine/api/datastore/Transaction.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="Transaction.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
com.google.appengine.api.datastore</FONT>
<BR>
Interface Transaction</H2>
<HR>
<DL>
<DT><PRE>public interface <B>Transaction</B></DL>
</PRE>

<P>
Describes a logical unit of work to be performed against the datastore.
 Operations performed as part of a single <A HREF="../../../../../com/google/appengine/api/datastore/Transaction.html" title="interface in com.google.appengine.api.datastore"><CODE>Transaction</CODE></A> succeed or fail
 as a unit.  Transactions can be committed and rolled back synchronously
 and asynchronously.
<P>

<P>
<HR>

<P>

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

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

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Commits the transaction.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.util.concurrent.Future&lt;java.lang.Void&gt;</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/google/appengine/api/datastore/Transaction.html#commitAsync()">commitAsync</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;An asynchronous implementation of <A HREF="../../../../../com/google/appengine/api/datastore/Transaction.html#commit()"><CODE>commit()</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/google/appengine/api/datastore/Transaction.html#getApp()">getApp</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/google/appengine/api/datastore/Transaction.html#getId()">getId</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/google/appengine/api/datastore/Transaction.html#isActive()">isActive</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/google/appengine/api/datastore/Transaction.html#rollback()">rollback</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Rolls back the transaction.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.util.concurrent.Future&lt;java.lang.Void&gt;</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/google/appengine/api/datastore/Transaction.html#rollbackAsync()">rollbackAsync</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;An asynchronous implementation of <A HREF="../../../../../com/google/appengine/api/datastore/Transaction.html#rollback()"><CODE>rollback()</CODE></A>.</TD>
</TR>
</TABLE>
&nbsp;
<P>

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

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

<A NAME="commit()"><!-- --></A><H3>
commit</H3>
<PRE>
void <B>commit</B>()</PRE>
<DL>
<DD>Commits the transaction.  Whether this call succeeds or fails, all
 subsequent method invocations on this object will throw
 <CODE>IllegalStateException</CODE>.
<P>
<DD><DL>

<DT><B>Throws:</B>
<DD><CODE>java.lang.IllegalStateException</CODE> - If the transaction has already been
 committed, rolled back, a commit or a rollback is in progress (via an
 async call), or an attempt to commit or roll back has already failed.  If
 there are any outstanding async datastore calls when this method is
 invoked, this method will block on the completion of those calls before
 proceeding.
<DD><CODE><A HREF="../../../../../com/google/appengine/api/datastore/DatastoreFailureException.html" title="class in com.google.appengine.api.datastore">DatastoreFailureException</A></CODE> - If a datastore error occurs.
<DD><CODE>ConcurrentModificationException</CODE> - If some other transaction modified
   the same entity groups concurrently.</DL>
</DD>
</DL>
<HR>

<A NAME="commitAsync()"><!-- --></A><H3>
commitAsync</H3>
<PRE>
java.util.concurrent.Future&lt;java.lang.Void&gt; <B>commitAsync</B>()</PRE>
<DL>
<DD>An asynchronous implementation of <A HREF="../../../../../com/google/appengine/api/datastore/Transaction.html#commit()"><CODE>commit()</CODE></A>.
<P>
<DD><DL>

<DT><B>Returns:</B><DD>A Future associated with the call.<DT><B>See Also:</B><DD><A HREF="../../../../../com/google/appengine/api/datastore/Transaction.html#commit()"><CODE>commit()</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="rollback()"><!-- --></A><H3>
rollback</H3>
<PRE>
void <B>rollback</B>()</PRE>
<DL>
<DD>Rolls back the transaction.  Whether this call succeeds or fails, all
 subsequent method invocations on this object will throw
 <CODE>IllegalStateException</CODE>.
<P>
<DD><DL>

<DT><B>Throws:</B>
<DD><CODE>java.lang.IllegalStateException</CODE> - If the transaction has already been
 committed, rolled back, a commit or a rollback is in progress (via an
 async call), or an attempt to commit or roll back has already failed.  If
 there are any outstanding async datastore calls when this method is
 invoked, this method will block on the completion of those calls before
 proceeding.
<DD><CODE><A HREF="../../../../../com/google/appengine/api/datastore/DatastoreFailureException.html" title="class in com.google.appengine.api.datastore">DatastoreFailureException</A></CODE> - If a datastore error occurs.</DL>
</DD>
</DL>
<HR>

<A NAME="rollbackAsync()"><!-- --></A><H3>
rollbackAsync</H3>
<PRE>
java.util.concurrent.Future&lt;java.lang.Void&gt; <B>rollbackAsync</B>()</PRE>
<DL>
<DD>An asynchronous implementation of <A HREF="../../../../../com/google/appengine/api/datastore/Transaction.html#rollback()"><CODE>rollback()</CODE></A>.
<P>
<DD><DL>

<DT><B>Returns:</B><DD>A Future associated with the call.<DT><B>See Also:</B><DD><A HREF="../../../../../com/google/appengine/api/datastore/Transaction.html#rollback()"><CODE>rollback()</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getId()"><!-- --></A><H3>
getId</H3>
<PRE>
java.lang.String <B>getId</B>()</PRE>
<DL>
<DD><DL>

<DT><B>Returns:</B><DD>The globally unique identifier for the <code>Transaction</code>.</DL>
</DD>
</DL>
<HR>

<A NAME="getApp()"><!-- --></A><H3>
getApp</H3>
<PRE>
java.lang.String <B>getApp</B>()</PRE>
<DL>
<DD><DL>

<DT><B>Returns:</B><DD>The application id for the <code>Transaction</code>.</DL>
</DD>
</DL>
<HR>

<A NAME="isActive()"><!-- --></A><H3>
isActive</H3>
<PRE>
boolean <B>isActive</B>()</PRE>
<DL>
<DD><DL>

<DT><B>Returns:</B><DD><code>true</code> if the transaction is active, <code>false</code> otherwise.</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../com/google/appengine/api/datastore/Text.html" title="class in com.google.appengine.api.datastore"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../com/google/appengine/api/datastore/TransactionOptions.html" title="class in com.google.appengine.api.datastore"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../index.html?com/google/appengine/api/datastore/Transaction.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="Transaction.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>

</BODY>
</HTML>