📄 jdbctransaction.html
字号:
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<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="../../../org/hibernate/HibernateException.html" title="class in org.hibernate">HibernateException</A></PRE>
<DL>
<DD><B>Description copied from interface: <CODE><A HREF="../../../org/hibernate/Transaction.html" title="interface in org.hibernate">Transaction</A></CODE></B></DD>
<DD>Begin a new transaction.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../org/hibernate/Transaction.html#begin()">begin</A></CODE> in interface <CODE><A HREF="../../../org/hibernate/Transaction.html" title="interface in org.hibernate">Transaction</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="../../../org/hibernate/HibernateException.html" title="class in org.hibernate">HibernateException</A></CODE></DL>
</DD>
</DL>
<HR>
<A NAME="commit()"><!-- --></A><H3>
commit</H3>
<PRE>
public void <B>commit</B>() throws <A HREF="../../../org/hibernate/HibernateException.html" title="class in org.hibernate">HibernateException</A></PRE>
<DL>
<DD><B>Description copied from interface: <CODE><A HREF="../../../org/hibernate/Transaction.html" title="interface in org.hibernate">Transaction</A></CODE></B></DD>
<DD>Flush the associated <tt>Session</tt> and end the unit of work (unless we are in <A HREF="../../../org/hibernate/FlushMode.html#NEVER"><CODE>FlushMode.NEVER</CODE></A>. </p> This method will commit the underlying transaction if and only if the underlying transaction was initiated by this object.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../org/hibernate/Transaction.html#commit()">commit</A></CODE> in interface <CODE><A HREF="../../../org/hibernate/Transaction.html" title="interface in org.hibernate">Transaction</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="../../../org/hibernate/HibernateException.html" title="class in org.hibernate">HibernateException</A></CODE></DL>
</DD>
</DL>
<HR>
<A NAME="rollback()"><!-- --></A><H3>
rollback</H3>
<PRE>
public void <B>rollback</B>() throws <A HREF="../../../org/hibernate/HibernateException.html" title="class in org.hibernate">HibernateException</A></PRE>
<DL>
<DD><B>Description copied from interface: <CODE><A HREF="../../../org/hibernate/Transaction.html" title="interface in org.hibernate">Transaction</A></CODE></B></DD>
<DD>Force the underlying transaction to roll back.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../org/hibernate/Transaction.html#rollback()">rollback</A></CODE> in interface <CODE><A HREF="../../../org/hibernate/Transaction.html" title="interface in org.hibernate">Transaction</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="../../../org/hibernate/HibernateException.html" title="class in org.hibernate">HibernateException</A></CODE></DL>
</DD>
</DL>
<HR>
<A NAME="wasRolledBack()"><!-- --></A><H3>
wasRolledBack</H3>
<PRE>
public boolean <B>wasRolledBack</B>()</PRE>
<DL>
<DD><B>Description copied from interface: <CODE><A HREF="../../../org/hibernate/Transaction.html" title="interface in org.hibernate">Transaction</A></CODE></B></DD>
<DD>Was this transaction rolled back or set to rollback only? <p/> This only accounts for actions initiated from this local transaction. If, for example, the underlying transaction is forced to rollback via some other means, this method still reports false because the rollback was not initiated from here.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../org/hibernate/Transaction.html#wasRolledBack()">wasRolledBack</A></CODE> in interface <CODE><A HREF="../../../org/hibernate/Transaction.html" title="interface in org.hibernate">Transaction</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>boolean True if the transaction was rolled back via this local transaction; false otherwise.</DL>
</DD>
</DL>
<HR>
<A NAME="wasCommitted()"><!-- --></A><H3>
wasCommitted</H3>
<PRE>
public boolean <B>wasCommitted</B>()</PRE>
<DL>
<DD><B>Description copied from interface: <CODE><A HREF="../../../org/hibernate/Transaction.html" title="interface in org.hibernate">Transaction</A></CODE></B></DD>
<DD>Check if this transaction was successfully committed. <p/> This method could return <tt>false</tt> even after successful invocation of <A HREF="../../../org/hibernate/Transaction.html#commit()"><CODE>Transaction.commit()</CODE></A>. As an example, JTA based strategies no-op on <A HREF="../../../org/hibernate/Transaction.html#commit()"><CODE>Transaction.commit()</CODE></A> calls if they did not start the transaction; in that case, they also report <A HREF="../../../org/hibernate/Transaction.html#wasCommitted()"><CODE>Transaction.wasCommitted()</CODE></A> as false.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../org/hibernate/Transaction.html#wasCommitted()">wasCommitted</A></CODE> in interface <CODE><A HREF="../../../org/hibernate/Transaction.html" title="interface in org.hibernate">Transaction</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>boolean True if the transaction was (unequivocally) committed via this local transaction; false otherwise.</DL>
</DD>
</DL>
<HR>
<A NAME="isActive()"><!-- --></A><H3>
isActive</H3>
<PRE>
public boolean <B>isActive</B>()</PRE>
<DL>
<DD><B>Description copied from interface: <CODE><A HREF="../../../org/hibernate/Transaction.html" title="interface in org.hibernate">Transaction</A></CODE></B></DD>
<DD>Is this transaction still active? <p/> Again, this only returns information in relation to the local transaction, not the actual underlying transaction.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../org/hibernate/Transaction.html#isActive()">isActive</A></CODE> in interface <CODE><A HREF="../../../org/hibernate/Transaction.html" title="interface in org.hibernate">Transaction</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>boolean Treu if this local transaction is still active.</DL>
</DD>
</DL>
<HR>
<A NAME="registerSynchronization(javax.transaction.Synchronization)"><!-- --></A><H3>
registerSynchronization</H3>
<PRE>
public void <B>registerSynchronization</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/javax/transaction/Synchronization.html" title="class or interface in javax.transaction">Synchronization</A> sync) throws <A HREF="../../../org/hibernate/HibernateException.html" title="class in org.hibernate">HibernateException</A></PRE>
<DL>
<DD><B>Description copied from interface: <CODE><A HREF="../../../org/hibernate/Transaction.html" title="interface in org.hibernate">Transaction</A></CODE></B></DD>
<DD>Register a user synchronization callback for this transaction.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../org/hibernate/Transaction.html#registerSynchronization(javax.transaction.Synchronization)">registerSynchronization</A></CODE> in interface <CODE><A HREF="../../../org/hibernate/Transaction.html" title="interface in org.hibernate">Transaction</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>sync</CODE> - The Synchronization callback to register.<DT><B>Throws:</B><DD><CODE><A HREF="../../../org/hibernate/HibernateException.html" title="class in org.hibernate">HibernateException</A></CODE></DL>
</DD>
</DL>
<HR>
<A NAME="setTimeout(int)"><!-- --></A><H3>
setTimeout</H3>
<PRE>
public void <B>setTimeout</B>(int seconds)</PRE>
<DL>
<DD><B>Description copied from interface: <CODE><A HREF="../../../org/hibernate/Transaction.html" title="interface in org.hibernate">Transaction</A></CODE></B></DD>
<DD>Set the transaction timeout for any transaction started by a subsequent call to <tt>begin()</tt> on this instance.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../org/hibernate/Transaction.html#setTimeout(int)">setTimeout</A></CODE> in interface <CODE><A HREF="../../../org/hibernate/Transaction.html" title="interface in org.hibernate">Transaction</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>seconds</CODE> - The number of seconds before a timeout.</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=3 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> </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="class-use/JDBCTransaction.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </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="../../../org/hibernate/transaction/JBossTransactionManagerLookup.html" title="class in org.hibernate.transaction"><B>PREV CLASS</B></A>
<A HREF="../../../org/hibernate/transaction/JDBCTransactionFactory.html" title="class in org.hibernate.transaction"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html" target="_top"><B>FRAMES</B></A>
<A HREF="JDBCTransaction.html" target="_top"><B>NO FRAMES</B></A>
<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: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -