问题描述
- javax.transaction.global.timeout 的作用是什么?
- 我是否需要在 CheckpointAlgorithm 中实现 checkpointTimeout()方法?
- 服务器配置级别上有什么吗?它如何与应用程序级别设置的内容发生相互作用?
- What is the role of javax.transaction.global.timeout?
- Do I need to implement the checkpointTimeout() method in CheckpointAlgorithm?
- Is there anything at the server config level? How does this interact with whatever is set at the application level?
推荐答案
(编辑2016-12-02:,对超时值设置为'0'时的默认行为进行了重新解释进行应用交易).
(Edit 2016-12-02: Reworked with an explanation of the defaulting behavior when a timeout value of '0' is set for the application transaction).
让我描述应用程序级别的选项以及它们如何与服务器级别的超时进行交互.
Let me describe the application-level options and how that interacts with the server-level timeout.
在WebSphere Liberty Java Batch的一个块步骤中,您可以设置应用程序级超时,也可以将超时值'0'设置为默认为服务器级超时.
In a chunk step in WebSphere Liberty Java Batch, you can either set an application-level timeout, or set a timeout value of '0' to default to a server-level timeout.
此外,您还可以通过单独的服务器级设置为任何非零应用程序级超时值设置上限.
In addition, you can also set an upper bound for any non-zero application-level timeout value through a separate server-level setting.
可以设置块事务超时:
在JSL中具有特殊步骤属性的步骤级别: javax.transaction.global.timeout (秒)
At the step level in JSL with special step property: javax.transaction.global.timeout(seconds)
例如
<step id="MyStep">
<properties>
<!-- In seconds -->
<property name="javax.transaction.global.timeout" value="120"/>
如果未在XML中明确定义,则默认为180(秒).
If not explicitly defined in XML, it defaults to 180 (seconds).
如果您需要更多动态/程序控制,则可以实现自定义 CheckpointAlgorithm 并写入其 checkpointTimeout()返回您想要的任何内容(即使您确实想要,每个块的值也不同).
If you need more dynamic/programmatic control you can implement a custom CheckpointAlgorithm and write its checkpointTimeout() to return whatever you want (a different value for each chunk even if you really wanted).
您可以防止应用程序设置的超时值太大.
You can prevent the application from setting too great a timeout value.
在服务器配置(server.xml)中,使用 propogatedOrBMTTranLifetimeTimeout :
In the server config (server.xml) use propogatedOrBMTTranLifetimeTimeout :
<transaction propogatedOrBMTTranLifetimeTimeout="90s"/>
通过javax.transaction.global.timeout
或您的 checkpointTimeout()方法
如果javax.transaction.global.timeout
设置为'0',或者您的 checkpointTimeout()方法返回'0' >,您将从服务器获得默认超时.
In the case that the javax.transaction.global.timeout
is set to '0' or the case that your checkpointTimeout() method returns '0', you will get a default timeout from the server.
此超时值默认为120秒.
This timeout value defaults to 120 seconds.
要更改服务器配置(server.xml),请使用 totalTranLifetimeTimeout ,例如:
To change in the server config (server.xml) use totalTranLifetimeTimeout, e.g.:
<transaction totalTranLifetimeTimeout="60s"/>
注意:
但是,如上所述,如果根本未设置javax.transaction.global.timeout
,则应用程序超时默认为180,因此 totalTranLifetimeTimeout 会不起作用.
Note:
As mentioned above, though, if javax.transaction.global.timeout
isn't set at all the application timeout defaults to 180, and so the totalTranLifetimeTimeout does NOT come into play.
注意: WDT 工具的设计视图使使用和记住这些服务器配置属性值更加容易.
Note: the WDT tool's Design View makes working with and remembering these server config attribute values much easier.
此处的 propogatedOrBMTTranLifetimeTimeout 属性基本上映射到传统的最大事务超时,而 totalTranLifetimeTimeout 映射显然更明显地是总事务传统上的生命周期超时.
The propogatedOrBMTTranLifetimeTimeout attribute here basically maps to the Maximum transaction timeout in traditional, while the totalTranLifetimeTimeout maps more obviously the Total transaction lifetime timeout in traditional.
此文档,在Liberty中仍然具有重要意义.
Some nice examples are described within this documentation which are still largely relevant in Liberty.
这篇关于如何在WebSphere Liberty Batch中配置事务超时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!