Synchronization (Java EE 5)

Java EE API


javax.transaction Interface Synchronization


public interface Synchronization


事务管理器支持一种同步机制,这种机制允许在事务完成之前和之后通知感兴趣的参与者。使用 registerSynchronization 方法,应用服务器可向当前与目标 Transaction 对象关联的事务注册一个 Synchronization 对象。
英文文档:

The transaction manager supports a synchronization mechanism that allows the interested party to be notified before and after the transaction completes. Using the registerSynchronization method, the application server registers a Synchronization object for the transaction currently associated with the target Transaction object.


Method Summary
 void
 void
 

Method Detail

public void beforeCompletion()
在启动二阶段事务提交过程之前,事务管理器调用 beforeCompletion 方法。使用要提交的事务的事务上下文执行此调用。
英文文档:

beforeCompletion

void beforeCompletion()
The beforeCompletion method is called by the transaction manager prior to the start of the two-phase transaction commit process. This call is executed with the transaction context of the transaction that is being committed.


public void afterCompletion(int status)
提交或回滚事务之后,事务管理器调用此方法。
status 事务的完成状态。
英文文档:

afterCompletion

void afterCompletion(int status)
This method is called by the transaction manager after the transaction is committed or rolled back.

Parameters:
status - The status of the transaction completion.


Submit a bug or feature

Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

一看就知道只有菜鸟才干这么无知的事啦。

PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!