activemq-artemis/docs/user-manual/zh/transaction-config.xml

30 lines
2.6 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="UTF-8"?>
<!-- ============================================================================= -->
<!-- Copyright © 2009 Red Hat, Inc. and others. -->
<!-- -->
<!-- The text of and illustrations in this document are licensed by Red Hat under -->
<!-- a Creative Commons AttributionShare Alike 3.0 Unported license ("CC-BY-SA"). -->
<!-- -->
<!-- An explanation of CC-BY-SA is available at -->
<!-- -->
<!-- http://creativecommons.org/licenses/by-sa/3.0/. -->
<!-- -->
<!-- In accordance with CC-BY-SA, if you distribute this document or an adaptation -->
<!-- of it, you must provide the URL for the original version. -->
<!-- -->
<!-- Red Hat, as the licensor of this document, waives the right to enforce, -->
<!-- and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent -->
<!-- permitted by applicable law. -->
<!-- ============================================================================= -->
<chapter id="transaction-config">
<title>配置资源管理器Resource Manager</title>
<para>HornetQ有自己的资源管理器来管理JTA事务。当一个事务开始时资源管理器就得到通知并记录下该事务和它的状态。
有的时候一个事务开始后,最終被忘记。有时客户端崩溃并且再也不能恢复,这样的话该事务就一直存在下去。</para>
<para>为了解决这个问题可以配置HornetQ来扫描过期的事务并且将它们回滚。默认值是3000000毫秒5分钟
它表示任何超过5分钟的事务都将被删除。这个超时对应的参数是<literal
>transaction-timeout</literal>,它在配置文件<literal>hornetq-configuration.xml</literal>中(单位毫秒)。
参数<literal>transaction-timeout-scan-period</literal>定义了HornetQ扫描过期事务的间隔。</para>
<para>注意HornetQ不会单方面回滚一个已经处于准备状态的XA事务。如果你认为这些事务永远不会被事务管理器transaction manager
来处理的话,你必须通过管理接口来进行回滚。</para>
</chapter>