usertransaction.html
来自「SUN公司官方J2EE中文帮助文档 应该不错 有兴趣的下来看看 html格式的」· HTML 代码 · 共 314 行
HTML
314 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Thu Jan 17 03:51:40 PST 2002 -->
<TITLE>
Java 2 Platform EE v1.3: Interface UserTransaction
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_top"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../javax/transaction/TransactionManager.html"><B>PREV CLASS</B></A>
NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A>
<A HREF="UserTransaction.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: INNER | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
javax.transaction</FONT>
<BR>
Interface UserTransaction</H2>
<HR>
<DL>
<DT>public interface <B>UserTransaction</B></DL>
<P>
The UserTransaction interface defines the methods that allow an
application to explicitly manage transaction boundaries.
<P>
<HR>
<P>
<!-- ======== INNER CLASS SUMMARY ======== -->
<!-- =========== FIELD SUMMARY =========== -->
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/transaction/UserTransaction.html#begin()">begin</A></B>()</CODE>
<BR>
Create a new transaction and associate it with the current thread.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/transaction/UserTransaction.html#commit()">commit</A></B>()</CODE>
<BR>
Complete the transaction associated with the current thread.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/transaction/UserTransaction.html#getStatus()">getStatus</A></B>()</CODE>
<BR>
Obtain the status of the transaction associated with the current thread.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/transaction/UserTransaction.html#rollback()">rollback</A></B>()</CODE>
<BR>
Roll back the transaction associated with the current thread.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/transaction/UserTransaction.html#setRollbackOnly()">setRollbackOnly</A></B>()</CODE>
<BR>
Modify the transaction associated with the current thread such that
the only possible outcome of the transaction is to roll back the
transaction.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/transaction/UserTransaction.html#setTransactionTimeout(int)">setTransactionTimeout</A></B>(int seconds)</CODE>
<BR>
Modify the value of the timeout value that is associated with the
transactions started by the current thread with the begin method.</TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="begin()"><!-- --></A><H3>
begin</H3>
<PRE>
public void <B>begin</B>()
throws <A HREF="../../javax/transaction/NotSupportedException.html">NotSupportedException</A>,
<A HREF="../../javax/transaction/SystemException.html">SystemException</A></PRE>
<DL>
<DD>Create a new transaction and associate it with the current thread.<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/transaction/NotSupportedException.html">NotSupportedException</A></CODE> - Thrown if the thread is already
associated with a transaction and the Transaction Manager
implementation does not support nested transactions.<DD><CODE><A HREF="../../javax/transaction/SystemException.html">SystemException</A></CODE> - Thrown if the transaction manager
encounters an unexpected error condition</DL>
</DD>
</DL>
<HR>
<A NAME="commit()"><!-- --></A><H3>
commit</H3>
<PRE>
public void <B>commit</B>()
throws <A HREF="../../javax/transaction/RollbackException.html">RollbackException</A>,
<A HREF="../../javax/transaction/HeuristicMixedException.html">HeuristicMixedException</A>,
<A HREF="../../javax/transaction/HeuristicRollbackException.html">HeuristicRollbackException</A>,
java.lang.SecurityException,
java.lang.IllegalStateException,
<A HREF="../../javax/transaction/SystemException.html">SystemException</A></PRE>
<DL>
<DD>Complete the transaction associated with the current thread. When this
method completes, the thread becomes associated with no transaction.<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/transaction/RollbackException.html">RollbackException</A></CODE> - Thrown to indicate that
the transaction has been rolled back rather than committed.<DD><CODE><A HREF="../../javax/transaction/HeuristicMixedException.html">HeuristicMixedException</A></CODE> - Thrown to indicate that a heuristic
decision was made and that some relevant updates have been committed
while others have been rolled back.<DD><CODE><A HREF="../../javax/transaction/HeuristicRollbackException.html">HeuristicRollbackException</A></CODE> - Thrown to indicate that a
heuristic decision was made and that some relevant updates have been
rolled back.<DD><CODE>java.lang.SecurityException</CODE> - Thrown to indicate that the thread is
not allowed to commit the transaction.<DD><CODE>java.lang.IllegalStateException</CODE> - Thrown if the current thread is
not associated with a transaction.<DD><CODE><A HREF="../../javax/transaction/SystemException.html">SystemException</A></CODE> - Thrown if the transaction manager
encounters an unexpected error condition</DL>
</DD>
</DL>
<HR>
<A NAME="rollback()"><!-- --></A><H3>
rollback</H3>
<PRE>
public void <B>rollback</B>()
throws java.lang.IllegalStateException,
java.lang.SecurityException,
<A HREF="../../javax/transaction/SystemException.html">SystemException</A></PRE>
<DL>
<DD>Roll back the transaction associated with the current thread. When this
method completes, the thread becomes associated with no transaction.<DD><DL>
<DT><B>Throws:</B><DD><CODE>java.lang.SecurityException</CODE> - Thrown to indicate that the thread is
not allowed to roll back the transaction.<DD><CODE>java.lang.IllegalStateException</CODE> - Thrown if the current thread is
not associated with a transaction.<DD><CODE><A HREF="../../javax/transaction/SystemException.html">SystemException</A></CODE> - Thrown if the transaction manager
encounters an unexpected error condition</DL>
</DD>
</DL>
<HR>
<A NAME="setRollbackOnly()"><!-- --></A><H3>
setRollbackOnly</H3>
<PRE>
public void <B>setRollbackOnly</B>()
throws java.lang.IllegalStateException,
<A HREF="../../javax/transaction/SystemException.html">SystemException</A></PRE>
<DL>
<DD>Modify the transaction associated with the current thread such that
the only possible outcome of the transaction is to roll back the
transaction.<DD><DL>
<DT><B>Throws:</B><DD><CODE>java.lang.IllegalStateException</CODE> - Thrown if the current thread is
not associated with a transaction.<DD><CODE><A HREF="../../javax/transaction/SystemException.html">SystemException</A></CODE> - Thrown if the transaction manager
encounters an unexpected error condition</DL>
</DD>
</DL>
<HR>
<A NAME="getStatus()"><!-- --></A><H3>
getStatus</H3>
<PRE>
public int <B>getStatus</B>()
throws <A HREF="../../javax/transaction/SystemException.html">SystemException</A></PRE>
<DL>
<DD>Obtain the status of the transaction associated with the current thread.<DD><DL>
<DT><B>Returns:</B><DD>The transaction status. If no transaction is associated with
the current thread, this method returns the Status.NoTransaction
value.<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/transaction/SystemException.html">SystemException</A></CODE> - Thrown if the transaction manager
encounters an unexpected error condition</DL>
</DD>
</DL>
<HR>
<A NAME="setTransactionTimeout(int)"><!-- --></A><H3>
setTransactionTimeout</H3>
<PRE>
public void <B>setTransactionTimeout</B>(int seconds)
throws <A HREF="../../javax/transaction/SystemException.html">SystemException</A></PRE>
<DL>
<DD>Modify the value of the timeout value that is associated with the
transactions started by the current thread with the begin method.
<p> If an application has not called this method, the transaction
service uses some default value for the transaction timeout.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>seconds</CODE> - The value of the timeout in seconds. If the value
is zero, the transaction service restores the default value.<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/transaction/SystemException.html">SystemException</A></CODE> - Thrown if the transaction manager
encounters an unexpected error condition</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../javax/transaction/TransactionManager.html"><B>PREV CLASS</B></A>
NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A>
<A HREF="UserTransaction.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: INNER | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?