当前位置: 代码迷 >> 综合 >> JBoss中事务超时的解决方案
  详细解决方案

JBoss中事务超时的解决方案

热度:41   发布时间:2024-01-19 00:11:52.0

    JBoss 中容器管理事务超时错误:

WARN  [TransactionImpl] Transaction TransactionImpl:XidImpl[FormatI d=257, GlobalId=lijing/17, BranchQual=, localId=17] timed out. status=STATUS_ACT IVE

   Jboss 中,容器管理事务的默认超时设为 300 秒,如果某一个方法需要很长时间的事务处理,则需要修改这个时间值。
在 jboss 的安装目录 /server/default/conf 下,打开 jboss-service.xml 文件,找到如下行:

   <mbean code="org.jboss.tm.TransactionManagerService"
      name="jboss:service=TransactionManager"
      xmbean-dd="resource:xmdesc/TransactionManagerService-xmbean.xml">
      <attribute name="TransactionTimeout">300</attribute>
      <!-- set to false to disable transaction demarcation over IIOP -->
      <attribute name="GlobalIdsEnabled">true</attribute>
      <depends optional-attribute-name="XidFactory">jboss:service=XidFactory</depends>
   </mbean>

    修改粗体部分的时间设置(单位为秒)。
  相关解决方案