EJB - 事务超时 [英] EJB - Transaction Time out
问题描述
摘自 JBoss Wiki ,其中指明了以下内容:
每个方法的基础:修改
元素
元素元素或
实体bean。它位于会话bean的
META-INF / jboss.xml部署
描述符中。当
事务超时在
指定方法级别时,它将覆盖
默认超时。关于这个元素的更多信息
可以在
jboss-x.x.x / docs / dtd / jboss_4_0.dtd中找到。
从testsuite采取的示例:
<?xml version =1.0 >?;
< jboss>
< enterprise-beans>
< session>
< ejb-name> TxTimeout< / ejb-name>
< jndi-name> jbosstest / tm / TxTimeout< / jndi-name>
< exception-on-rollback> true< / exception-on-rollback>
< method-attributes>
< method>
< method-name> testOverriddenTimeoutExpires< / method-name>
< transaction-timeout> 5< / transaction-timeout>
< / method>
< method>
< method-name> testOverriddenTimeoutDoesNotExpire< / method-name>
< transaction-timeout> 20< / transaction-timeout>
< / method>
< / method-attributes>
< / session>
< / enterprise-beans>
< / jboss>
How can we define method level transaction timeout in Session EJB (Container Managed Transaction) in JBOSS 4 container?
This is excerpt from JBoss Wiki which specifies exactly this:
Per-method basis: Modifying the element inside the element of a session or entity bean. This is located in the META-INF/jboss.xml deployment descriptor of a session bean. When the transaction timeout is specified at the method level, it overrides the default timeout. Further information about this element can be found in jboss-x.x.x/docs/dtd/jboss_4_0.dtd. Example taken from the testsuite:
<?xml version="1.0"?>
<jboss>
<enterprise-beans>
<session>
<ejb-name>TxTimeout</ejb-name>
<jndi-name>jbosstest/tm/TxTimeout</jndi-name>
<exception-on-rollback>true</exception-on-rollback>
<method-attributes>
<method>
<method-name>testOverriddenTimeoutExpires</method-name>
<transaction-timeout>5</transaction-timeout>
</method>
<method>
<method-name>testOverriddenTimeoutDoesNotExpire</method-name>
<transaction-timeout>20</transaction-timeout>
</method>
</method-attributes>
</session>
</enterprise-beans>
</jboss>
这篇关于EJB - 事务超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!