blob: b5588bafa2818c3a831b86c63e09fc154def2fb2 [file] [log] [blame]
<!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_05-ea) on Fri Oct 10 11:21:06 PDT 2008 -->
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<TITLE>
Transaction (JDO2 API 2.2)
</TITLE>
<META NAME="date" CONTENT="2008-10-10">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Transaction (JDO2 API 2.2)";
}
}
</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="class-use/Transaction.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../javax/jdo/Query.html" title="interface in javax.jdo"><B>PREV CLASS</B></A>&nbsp;
&nbsp;NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html?javax/jdo/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">
javax.jdo</FONT>
<BR>
Interface Transaction</H2>
<HR>
<DL>
<DT><PRE>public interface <B>Transaction</B></DL>
</PRE>
<P>
The JDO <code>Transaction</code> interface provides for initiation and
completion of transactions under user control.
It is a sub-interface of the <A HREF="../../javax/jdo/PersistenceManager.html" title="interface in javax.jdo"><CODE>PersistenceManager</CODE></A>
that deals with options and transaction demarcation.
<P>Transaction options include whether optimistic concurrency
control should be used for the current transaction, whether instances
may hold values in the cache outside transactions, and whether
values should be retained in the cache after transaction completion. These
options are valid for both managed and non-managed transactions.
<P>Transaction initiation and completion methods have similar semantics to
<code>javax.transaction.UserTransaction</code> when used outside a managed
environment. When used in a managed environment, transaction initiation
and completion methods may only be used with bean-managed transaction
semantics.
<P>
<P>
<DL>
<DT><B>Version:</B></DT>
<DD>2.2</DD>
</DL>
<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="../../javax/jdo/Transaction.html#begin()">begin</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Begin a transaction.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/jdo/Transaction.html#commit()">commit</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Commit the current transaction.</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="../../javax/jdo/Transaction.html#getIsolationLevel()">getIsolationLevel</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the value for transaction isolation level for this transaction.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/jdo/Transaction.html#getNontransactionalRead()">getNontransactionalRead</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If <code>true</code>, allows persistent instances to be read without
a transaction active.</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="../../javax/jdo/Transaction.html#getNontransactionalWrite()">getNontransactionalWrite</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If <code>true</code>, allows persistent instances to be written without
a transaction active.</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="../../javax/jdo/Transaction.html#getOptimistic()">getOptimistic</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Optimistic transactions do not hold data store locks until commit time.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../javax/jdo/PersistenceManager.html" title="interface in javax.jdo">PersistenceManager</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/jdo/Transaction.html#getPersistenceManager()">getPersistenceManager</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The <code>Transaction</code> instance is always associated with exactly
one <code>PersistenceManager</code>.</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="../../javax/jdo/Transaction.html#getRestoreValues()">getRestoreValues</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return the current value of the restoreValues property.</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="../../javax/jdo/Transaction.html#getRetainValues()">getRetainValues</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If <code>true</code>, at commit time instances retain their field
values.</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="../../javax/jdo/Transaction.html#getRollbackOnly()">getRollbackOnly</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the rollback-only status of the transaction.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;javax.transaction.Synchronization</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/jdo/Transaction.html#getSynchronization()">getSynchronization</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The user-specified <code>Synchronization</code> instance for this
<code>Transaction</code> instance.</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="../../javax/jdo/Transaction.html#isActive()">isActive</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns whether there is a transaction currently active.</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="../../javax/jdo/Transaction.html#rollback()">rollback</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Roll back the current transaction.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/jdo/Transaction.html#setIsolationLevel(java.lang.String)">setIsolationLevel</A></B>(java.lang.String&nbsp;level)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the value for transaction isolation level for this transaction.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/jdo/Transaction.html#setNontransactionalRead(boolean)">setNontransactionalRead</A></B>(boolean&nbsp;nontransactionalRead)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If <code>true</code>, allow persistent instances to be read without
a transaction active.</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="../../javax/jdo/Transaction.html#setNontransactionalWrite(boolean)">setNontransactionalWrite</A></B>(boolean&nbsp;nontransactionalWrite)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If <code>true</code>, allow persistent instances to be written without
a transaction active.</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="../../javax/jdo/Transaction.html#setOptimistic(boolean)">setOptimistic</A></B>(boolean&nbsp;optimistic)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Optimistic transactions do not hold data store locks until commit time.</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="../../javax/jdo/Transaction.html#setRestoreValues(boolean)">setRestoreValues</A></B>(boolean&nbsp;restoreValues)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If <code>true</code>, at rollback, fields of newly persistent instances
are restored to
their values as of the beginning of the transaction, and the instances
revert to transient.</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="../../javax/jdo/Transaction.html#setRetainValues(boolean)">setRetainValues</A></B>(boolean&nbsp;retainValues)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If <code>true</code>, at commit instances retain their values and the
instances transition to persistent-nontransactional.</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="../../javax/jdo/Transaction.html#setRollbackOnly()">setRollbackOnly</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the rollback-only status of the transaction to <code>true</code>.</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="../../javax/jdo/Transaction.html#setSynchronization(javax.transaction.Synchronization)">setSynchronization</A></B>(javax.transaction.Synchronization&nbsp;sync)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The user can specify a <code>Synchronization</code> instance to be
notified on transaction completions.</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="begin()"><!-- --></A><H3>
begin</H3>
<PRE>
void <B>begin</B>()</PRE>
<DL>
<DD>Begin a transaction. The type of transaction is determined by the
setting of the Optimistic flag.
<P>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../javax/jdo/JDOUserException.html" title="class in javax.jdo">JDOUserException</A></CODE> - if transactions are managed by a container
in the managed environment, or if the transaction is already active.<DT><B>See Also:</B><DD><A HREF="../../javax/jdo/Transaction.html#setOptimistic(boolean)"><CODE>setOptimistic(boolean)</CODE></A>,
<A HREF="../../javax/jdo/Transaction.html#getOptimistic()"><CODE>getOptimistic()</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="commit()"><!-- --></A><H3>
commit</H3>
<PRE>
void <B>commit</B>()</PRE>
<DL>
<DD>Commit the current transaction.
<P>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../javax/jdo/JDOUserException.html" title="class in javax.jdo">JDOUserException</A></CODE> - if transactions are managed by a container
in the managed environment, or if the transaction is not active.</DL>
</DD>
</DL>
<HR>
<A NAME="rollback()"><!-- --></A><H3>
rollback</H3>
<PRE>
void <B>rollback</B>()</PRE>
<DL>
<DD>Roll back the current transaction.
<P>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../javax/jdo/JDOUserException.html" title="class in javax.jdo">JDOUserException</A></CODE> - if transactions are managed by a container
in the managed environment, or if the transaction is not active.</DL>
</DD>
</DL>
<HR>
<A NAME="isActive()"><!-- --></A><H3>
isActive</H3>
<PRE>
boolean <B>isActive</B>()</PRE>
<DL>
<DD>Returns whether there is a transaction currently active.
<P>
<DD><DL>
<DT><B>Returns:</B><DD><code>true</code> if the transaction is active.</DL>
</DD>
</DL>
<HR>
<A NAME="getRollbackOnly()"><!-- --></A><H3>
getRollbackOnly</H3>
<PRE>
boolean <B>getRollbackOnly</B>()</PRE>
<DL>
<DD>Returns the rollback-only status of the transaction. When
begun, the rollback-only status is false. Either the
application or the JDO implementation may set this flag
using setRollbackOnly.
<P>
<DD><DL>
<DT><B>Returns:</B><DD><code>true</code> if the transaction has been
marked for rollback.<DT><B>Since:</B></DT>
<DD>2.0</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="setRollbackOnly()"><!-- --></A><H3>
setRollbackOnly</H3>
<PRE>
void <B>setRollbackOnly</B>()</PRE>
<DL>
<DD>Sets the rollback-only status of the transaction to <code>true</code>.
After this flag is set to <code>true</code>, the transaction
can no longer be committed, and any attempt to commit the
transaction will throw <code>JDOFatalDataStoreException<code>.
<P>
<DD><DL>
<DT><B>Since:</B></DT>
<DD>2.0</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="setNontransactionalRead(boolean)"><!-- --></A><H3>
setNontransactionalRead</H3>
<PRE>
void <B>setNontransactionalRead</B>(boolean&nbsp;nontransactionalRead)</PRE>
<DL>
<DD>If <code>true</code>, allow persistent instances to be read without
a transaction active.
If an implementation does not support this option, a
<code>JDOUnsupportedOptionException</code> is thrown.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>nontransactionalRead</CODE> - the value of the nontransactionalRead
property</DL>
</DD>
</DL>
<HR>
<A NAME="getNontransactionalRead()"><!-- --></A><H3>
getNontransactionalRead</H3>
<PRE>
boolean <B>getNontransactionalRead</B>()</PRE>
<DL>
<DD>If <code>true</code>, allows persistent instances to be read without
a transaction active.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the value of the nontransactionalRead property</DL>
</DD>
</DL>
<HR>
<A NAME="setNontransactionalWrite(boolean)"><!-- --></A><H3>
setNontransactionalWrite</H3>
<PRE>
void <B>setNontransactionalWrite</B>(boolean&nbsp;nontransactionalWrite)</PRE>
<DL>
<DD>If <code>true</code>, allow persistent instances to be written without
a transaction active.
If an implementation does not support this option, a
<code>JDOUnsupportedOptionException</code> is thrown.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>nontransactionalWrite</CODE> - the value of the nontransactionalRead
property</DL>
</DD>
</DL>
<HR>
<A NAME="getNontransactionalWrite()"><!-- --></A><H3>
getNontransactionalWrite</H3>
<PRE>
boolean <B>getNontransactionalWrite</B>()</PRE>
<DL>
<DD>If <code>true</code>, allows persistent instances to be written without
a transaction active.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the value of the nontransactionalWrite property</DL>
</DD>
</DL>
<HR>
<A NAME="setRetainValues(boolean)"><!-- --></A><H3>
setRetainValues</H3>
<PRE>
void <B>setRetainValues</B>(boolean&nbsp;retainValues)</PRE>
<DL>
<DD>If <code>true</code>, at commit instances retain their values and the
instances transition to persistent-nontransactional.
If an implementation does not support this option, a
<code>JDOUnsupportedOptionException</code> is thrown.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>retainValues</CODE> - the value of the retainValues property</DL>
</DD>
</DL>
<HR>
<A NAME="getRetainValues()"><!-- --></A><H3>
getRetainValues</H3>
<PRE>
boolean <B>getRetainValues</B>()</PRE>
<DL>
<DD>If <code>true</code>, at commit time instances retain their field
values.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the value of the retainValues property</DL>
</DD>
</DL>
<HR>
<A NAME="setRestoreValues(boolean)"><!-- --></A><H3>
setRestoreValues</H3>
<PRE>
void <B>setRestoreValues</B>(boolean&nbsp;restoreValues)</PRE>
<DL>
<DD>If <code>true</code>, at rollback, fields of newly persistent instances
are restored to
their values as of the beginning of the transaction, and the instances
revert to transient. Additionally, fields of modified
instances of primitive types and immutable reference types
are restored to their values as of the beginning of the
transaction.
<P>If <code>false</code>, at rollback, the values of fields of
newly persistent instances are unchanged and the instances revert to
transient. Additionally, dirty instances transition to hollow.
If an implementation does not support this option, a
<code>JDOUnsupportedOptionException</code> is thrown.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>restoreValues</CODE> - the value of the restoreValues property</DL>
</DD>
</DL>
<HR>
<A NAME="getRestoreValues()"><!-- --></A><H3>
getRestoreValues</H3>
<PRE>
boolean <B>getRestoreValues</B>()</PRE>
<DL>
<DD>Return the current value of the restoreValues property.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the value of the restoreValues property</DL>
</DD>
</DL>
<HR>
<A NAME="setOptimistic(boolean)"><!-- --></A><H3>
setOptimistic</H3>
<PRE>
void <B>setOptimistic</B>(boolean&nbsp;optimistic)</PRE>
<DL>
<DD>Optimistic transactions do not hold data store locks until commit time.
If an implementation does not support this option, a
<code>JDOUnsupportedOptionException</code> is thrown.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>optimistic</CODE> - the value of the Optimistic flag.</DL>
</DD>
</DL>
<HR>
<A NAME="getOptimistic()"><!-- --></A><H3>
getOptimistic</H3>
<PRE>
boolean <B>getOptimistic</B>()</PRE>
<DL>
<DD>Optimistic transactions do not hold data store locks until commit time.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the value of the Optimistic property.</DL>
</DD>
</DL>
<HR>
<A NAME="getIsolationLevel()"><!-- --></A><H3>
getIsolationLevel</H3>
<PRE>
java.lang.String <B>getIsolationLevel</B>()</PRE>
<DL>
<DD>Get the value for transaction isolation level for this transaction.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the transaction isolation level<DT><B>Since:</B></DT>
<DD>2.2</DD>
<DT><B>See Also:</B><DD><A HREF="../../javax/jdo/Transaction.html#setIsolationLevel(java.lang.String)"><CODE>setIsolationLevel(String)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setIsolationLevel(java.lang.String)"><!-- --></A><H3>
setIsolationLevel</H3>
<PRE>
void <B>setIsolationLevel</B>(java.lang.String&nbsp;level)</PRE>
<DL>
<DD>Set the value for transaction isolation level for this transaction.
Transaction isolation levels are defined in javax.jdo.Constants.
If the requested level is not available, but a higher level is
available, the higher level is silently used.
If the requested level is not available, and no higher level is
available, then JDOUnsupportedOptionException is thrown.
Five standard isolation levels are defined. Other isolation levels
might be supported by an implementation but are not standard.
<p>Standard values in order of low to high are:
<ul><li>read-uncommitted
</li><li>read-committed
</li><li>repeatable-read
</li><li>snapshot
</li><li>serializable
</li></ul>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>level</CODE> - the transaction isolation level<DT><B>Since:</B></DT>
<DD>2.2</DD>
<DT><B>See Also:</B><DD><A HREF="../../javax/jdo/Transaction.html#getIsolationLevel()"><CODE>getIsolationLevel()</CODE></A>,
<A HREF="../../javax/jdo/Constants.html#TX_READ_UNCOMMITTED"><CODE>Constants.TX_READ_UNCOMMITTED</CODE></A>,
<A HREF="../../javax/jdo/Constants.html#TX_READ_COMMITTED"><CODE>Constants.TX_READ_COMMITTED</CODE></A>,
<A HREF="../../javax/jdo/Constants.html#TX_REPEATABLE_READ"><CODE>Constants.TX_REPEATABLE_READ</CODE></A>,
<A HREF="../../javax/jdo/Constants.html#TX_SNAPSHOT"><CODE>Constants.TX_SNAPSHOT</CODE></A>,
<A HREF="../../javax/jdo/Constants.html#TX_SERIALIZABLE"><CODE>Constants.TX_SERIALIZABLE</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setSynchronization(javax.transaction.Synchronization)"><!-- --></A><H3>
setSynchronization</H3>
<PRE>
void <B>setSynchronization</B>(javax.transaction.Synchronization&nbsp;sync)</PRE>
<DL>
<DD>The user can specify a <code>Synchronization</code> instance to be
notified on transaction completions. The <code>beforeCompletion</code>
method is called prior to flushing instances to the data store.
<P>The <code>afterCompletion</code> method is called after performing
state transitions of persistent and transactional instances, following
the data store commit or rollback operation.
<P>Only one <code>Synchronization</code> instance can be registered with
the <code>Transaction</code>. If the application requires more than one
instance to receive synchronization callbacks, then the single
application instance is responsible for managing them, and forwarding
callbacks to them.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>sync</CODE> - the <code>Synchronization</code> instance to be notified;
<code>null</code> for none</DL>
</DD>
</DL>
<HR>
<A NAME="getSynchronization()"><!-- --></A><H3>
getSynchronization</H3>
<PRE>
javax.transaction.Synchronization <B>getSynchronization</B>()</PRE>
<DL>
<DD>The user-specified <code>Synchronization</code> instance for this
<code>Transaction</code> instance.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the user-specified <code>Synchronization</code> instance.</DL>
</DD>
</DL>
<HR>
<A NAME="getPersistenceManager()"><!-- --></A><H3>
getPersistenceManager</H3>
<PRE>
<A HREF="../../javax/jdo/PersistenceManager.html" title="interface in javax.jdo">PersistenceManager</A> <B>getPersistenceManager</B>()</PRE>
<DL>
<DD>The <code>Transaction</code> instance is always associated with exactly
one <code>PersistenceManager</code>.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the <code>PersistenceManager</code> for this
<code>Transaction</code> instance</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="class-use/Transaction.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../javax/jdo/Query.html" title="interface in javax.jdo"><B>PREV CLASS</B></A>&nbsp;
&nbsp;NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html?javax/jdo/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>
Copyright &copy; 2005-2008 Apache Software Foundation. All Rights Reserved.
</BODY>
</HTML>