ITeye博客

说说ejb的事务传播机制

x_root · 2011-05-13 11:18 · Java · 企业架构 · EJB · Markdown

说说ejb的事务传播机制 1、MANDATORY Support a current transaction; throw an exception if no current transaction exists. 就是说支持当前的事务,如果当前没有事务,则会抛出一个异常;

2、REQUIRED Support a current transaction; create a new one if none exists. 支持当前事务,如果当前没有事务,则创建一个新的事务;

3、REQUIRES_NEW Create a new transaction, suspending the current transaction if one exists. 支持当前事务,如果当前有事务,则挂起当前事务,并创建一个新的事务;

4、SUPPORTS Support a current transaction; execute non-transactionally if none exists. 支持当前事务,如果当前事务不存在,则以非事务的方式运行;

5、NOT_SUPPORTED Do not support a current transaction; rather always execute non-transactionally. 不支持当前事务,总是以非事务的方式运行;

6、NEVER Do not support a current transaction; throw an exception if a current transaction 不支持当前事务,如果当前存在事务,则抛出异常;

评论(1)

  1. #1 楼 · x_root · 2011-07-08 10:55

    javax.ejb.TransactionAttributeType

评论功能维护中,当前仅展示历史评论。