REQUIRES_NEW transaction attribute pitfalls.
REQUIRES_NEW事务属性陷阱。
The RequiresNew transaction attribute is an interesting one.
RequiresNew事务属性非常有趣。
The most common container-managed transaction attribute is Required.
最常用的容器管理的事务属性是Required。
All of the EJB methods are configured with the Required transaction attribute.
所有的EJB方法都是用Required事务属性配置的。
In this case, the client is starting the transaction; hence the REQUIRED transaction attribute.
在这种情况下,客户机启动事务;因此使用REQUIRED事务属性。
The only use case I have been able to come up with for this transaction attribute is for testing.
我能想到的针对此事务属性的唯一一个用例就是用于测试。
The possible values for the transaction attribute and their descriptions are provided in Table 1.
事务属性的可能值及其描述在表1中列出。
An example of a LTC is an execution of a bean method with the transaction attribute NotSupported.
LTC的一个示例是含事务属性NotSupported的Bean方法的执行。
The key to transactional control with CMT is the EJB transaction attribute, which is discussed next.
使用CMT的事务控制的关键是接下来讨论的EJB事务属性。
This is the most commonly used transaction attribute and is the default for both EJB 3.0 and Spring.
这是最常用的事务属性,并且是EJB 3.0和Spring 的默认属性。
We tell the transaction advisor to apply the REQUIRED transaction attribute to all of the declared methods.
我们告诉事务顾问将 REQUIRED 事务属性应用于所有声明的方法。
All public read methods in the API layer by default should be marked with a transaction attribute of SUPPORTS.
api层中的所有公共读方法默认都应该标记一个SUPPORTS事务属性。
For example, it might invoke a message-driven bean (MDB) with a container manager transaction attribute of Supports.
例如,它可能使用Supports的容器管理器事务属性来调用消息驱动bean (MDB)。
There are only a few use cases for this transaction attribute, and they primarily involve database stored procedures.
这个事务属性只有少许用例,并且它们主要涉及数据库存储过程。
Interleaved transactions are enabled when a bean method's transaction attribute is set to RequiresNew in the deployment descriptor.
当bean方法的事务属性在部署描述符中设置为RequiresNew时,可以支持交叉事务。
This returns true if the MDB is using container-managed transactions and the method in question has a transaction attribute of Required.
如果MDB正在使用容器托管的事务,而且要处理的方法具有Required事务属性,那么isDeliveryTransacted会返回true。
In addition to the rollback directives, you must also specify the transaction attribute, which defines how the transaction should behave.
除了回滚指令之外,您还必须指定事务属性,这将定义事务的行为。
The EJB container starts a global transaction when the EJB methods are configured with the Required or RequiresNew transaction attribute.
当使用Required或RequiresNew事务属性配置了EJB方法时,EJB容器就启动一个全局事务。
The semantics of the REQUIRED transaction attribute are the same as in J2EE, meaning that the method will always execute within a transaction.
REQUIRED事务属性的语义与J2EE中相同,这意味着该方法将始终在事务中执行。
If the transaction attribute takes the other allowed value of NotSupported, or the MDB is using bean-managed transactions, then it returns false.
如果事务属性采用NotSupported允许的其他值,或者MDB正在使用bean托管的事务,则返回false。
The transaction attribute can be specified for any session or entity bean method. The following attributes are defined in the EJB 2.1 specification.
可以为任何会话或实体bean方法指定事务属性。
The REQUIRES_NEW transaction attribute always starts a new transaction when the method is started, whether or not an existing transaction is present.
REQUIRES_NEW事务属性总是会在启动方法时启动一个新的事务。
For each of the transaction strategies I'll cover in subsequent articles in this series, I'll discuss use of this transaction attribute in more detail.
对于本系列后续文章将要讨论的各事务策略,我将更加详细地阐述这个事务属性。
If an endpoint method with a transaction attribute of Required is invoked on a thread with an imported transaction, then the method will inherit that transaction.
如果用导入的事务调用具有事务属性Required的端点方法,那么这个方法将继承该事务。
The transaction attribute and the initial presence of a transaction context both affect the ECI call type and the resulting transactional scope of the call to CICS.
事务属性和事务上下文的初始存在都会影响ECI调用类型和对 CICS 调用最后得到的事务范围。
When you use the REQUIRES_NEW transaction attribute, if an existing transaction context is present, the current transaction is suspended and a new transaction started.
使用 REQUIRES_NEW事务属性时,如果存在现有事务上下文,当前的事务会被挂起并启动一个新事务。
However, if you were to use something like the NotSupported transaction attribute instead, it would cause the database query to read from the table, not the transaction log.
但是,如果您使用的是NotSupported事务属性,那么它会造成数据库查询从表中而不是从事务日志中读取数据。
And public read operations by default should have a transaction attribute of SUPPORTS with no rollback logic. Listing 5 below illustrates this transaction-strategy implementation.
任何公共读方法在默认情况下都应该有一个事务属性SUPPORTS,其中不包含回滚逻辑。
Both the setting of the transaction attribute, and whether or not a global transaction context is present, will affect the ECI call type and the resulting transactional scope in CICS.
事务属性的设置和全局上下文是否存在,都会影响CICS中的ECI的访问类型和最后所得到的事务作用域。
The domain class properly has a transaction attribute of MANDATORY because the client is starting the transaction, and the domain model (insertTrade()) is not responsible for rollback.
域类属性有一个事务属性MANDATORY,因为客户机正在启动事务,而域模型(insertTrade())不负责执行回滚。
应用推荐