<!-- -->
|
JavaTM 2 Platform Ent. Ed. v1.4 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES <!-- if(window==top) { document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> All Classes <noscript></noscript> | |||||||
SUMMARY:NESTED|FIELD|CONSTR|METHOD | DETAIL:FIELD|CONSTR|METHOD |
The Transaction interface allows operations to be performed against the transaction in the target Transaction object. A Transaction object is created corresponding to each global transaction creation. The Transaction object can be used for resource enlistment, synchronization registration, transaction completion, and status query operations. Transaction接口允许操作执行基于目标Transaction对象的事务。创建一个Transaction对象 符合每一个全局事务创建。Transaction对象可以用于资源征集、同步注册、事务完成和状态查询操作。
<!-- ======== NESTED CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><!-- ======== CONSTRUCTOR SUMMARY ======== --><!-- ========== METHOD SUMMARY =========== --><!-- -->
Method Summary | |
void |
commit() Complete the transaction represented by this Transaction object. 完成Transaction对象表示的事务。 |
boolean |
delistResource(XAResourcexaRes, intflag) Disassociate the resource specified from the transaction associated with the target Transaction object. 解除与目标Transaction对象关联的事务指定的资源关联。 |
boolean |
enlistResource(XAResourcexaRes) Enlist the resource specified with the transaction associated with the target Transaction object. 加入与目标Transaction对象关联的事务指定的资源。 |
int |
getStatus() Obtain the status of the transaction associated with the target Transaction object. 获取与目标Transaction对象关联的事务状态。 |
void |
registerSynchronization(Synchronizationsync) Register a synchronization object for the transaction currently associated with the target object. 为目前与目标对象关联的事务注册一个同步对象。 |
void |
rollback() Rollback the transaction represented by this Transaction object. 回滚Transaction对象表示的事务。 |
void |
setRollbackOnly() Modify the transaction associated with the target object such that the only possible outcome of the transaction is to roll back the transaction. 修改当前线程的关联事务,使得事务的唯一可能结果是回滚该事务。 |
<!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><!-- ============ METHOD DETAIL ========== --><!-- -->
Method Detail |
public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException
RollbackException
- Thrown to indicate that the transaction has been rolled back rather than committed. 抛出表示事务已被回滚而不是提交。
HeuristicMixedException
- Thrown to indicate that a heuristic decision was made and that some relevant updates have been committed while others have been rolled back. 抛出表示试探性决定已经作出,某些相关更新已提交,然而其它一些被回滚。
HeuristicRollbackException
- Thrown to indicate that a heuristic decision was made and that all relevant updates have been rolled back. 抛出表示试探性决定已经做出,但所有相关更新已回滚。
SecurityException
- Thrown to indicate that the thread is not allowed to commit the transaction. 抛出表示当前线程不允许提交事务。
IllegalStateException
- Thrown if the transaction in the target object is inactive. 如果目标对象的事务为非活动状态则抛出。
SystemException
- Thrown if the transaction manager encounters an unexpected error condition. 如果事务管理器遭遇无法预料错误的情况时抛出。
public boolean delistResource(XAResourcexaRes, intflag) throws IllegalStateException, SystemException
xaRes
- The XAResource object associated with the resource (connection). 与资源关联的XAResource对象(连接)。
flag
- One of the values of TMSUCCESS, TMSUSPEND, or TMFAIL. TMSUCCESS、TMSUSPEND或者TMFAIL值之一。
IllegalStateException
- Thrown if the transaction in the target object is inactive. 如果目标对象的事务为非活动状态则抛出。
SystemException
- Thrown if the transaction manager encounters an unexpected error condition. 如果事务管理器遭遇无法预料错误的情况时抛出。
public boolean enlistResource(XAResourcexaRes) throws RollbackException, IllegalStateException, SystemException
xaRes
- The XAResource object associated with the resource (connection). 与资源关联的XAResource对象(连接)。
RollbackException
- Thrown to indicate that the transaction has been marked for rollback only. 抛出表示事务已被标记为仅回滚。
IllegalStateException
- Thrown if the transaction in the target object is in the prepared state or the transaction is inactive. 如果目标对象的事务在准备状态或者为非活动状态则抛出。
SystemException
- Thrown if the transaction manager encounters an unexpected error condition. 如果事务管理器遭遇无法预料错误的情况时抛出。
public int getStatus() throws SystemException
SystemException
- Thrown if the transaction manager encounters an unexpected error condition. 如果事务管理器遭遇无法预料错误的情况时抛出。
public void registerSynchronization(Synchronizationsync) throws RollbackException, IllegalStateException, SystemException
sync
- The Synchronization object for the transaction associated with the target object. 与目标对象关联事务的Synchronization对象。
RollbackException
- Thrown to indicate that the transaction has been marked for rollback only. 抛出表示事务已被标记为仅回滚。
IllegalStateException
- Thrown if the transaction in the target object is in the prepared state or the transaction is inactive. 如果目标对象的事务在准备状态或者为非活动状态则抛出。
SystemException
- Thrown if the transaction manager encounters an unexpected error condition. 如果事务管理器遭遇无法预料错误的情况时抛出。
public void rollback() throws IllegalStateException, SystemException
IllegalStateException
- Thrown if the transaction in the target object is in the prepared state or the transaction is inactive. 如果目标对象的事务在准备状态或者为非活动状态则抛出。
SystemException
- Thrown if the transaction manager encounters an unexpected error condition. 如果事务管理器遭遇无法预料错误的情况时抛出。
public void setRollbackOnly() throws IllegalStateException, SystemException
IllegalStateException
- Thrown if the target object is not associated with any transaction. 如果目标对象没有和关联任何事务时抛出。
SystemException
- Thrown if the transaction manager encounters an unexpected error condition. 如果事务管理器遭遇无法预料错误的情况时抛出。
<!-- -->
|
JavaTM 2 Platform Ent. Ed. v1.4 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES <!-- if(window==top) { document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> All Classes <noscript></noscript> | |||||||
SUMMARY:NESTED|FIELD|CONSTR|METHOD | DETAIL:FIELD|CONSTR|METHOD |
Copyright 2003 Sun Microsystems, Inc. All rights reserved.