Websphere运行时事务超时问题

huangapple 未分类评论55阅读模式
标题翻译

Websphere Runtime transaction timeout problem

问题

我们使用两个应用服务器,Jboss 和 Websphere(v8.5.5.11)。
在本地平台上,我们使用 Jboss,但开发服务器使用 Websphere。我想在运行时更改 Websphere 的事务超时时间。在 Jboss 上可以正常工作,但在 Websphere 上不行。我该如何为 Websphere 的线程设置事务超时时间。

JtaTransactionManager tm = (JtaTransactionManager) SpringApplicationContext.getContext().getBean(PlatformTransactionManager.class);
tm.getUserTransaction().setTransactionTimeout(timeout);
英文翻译

We use two application server ,Jboss and Websphere (v8.5.5.11).
We are using jboss in local platform but development server uses Websphere.I want to change transaction timeout on runtime .On Jboss works fine but websphere not.How can I set transaction timeout for websphere's thread.

JtaTransactionManager  tm = (JtaTransactionManager) SpringApplicationContext.getContext().getBean(PlatformTransactionManager.class);
tm.getUserTransaction().setTransactionTimeout(timeout);

答案1

得分: 0

以下是翻译好的内容:

这里是一个示例,用于获取 WebSphere 应用服务器事务管理器,以便在线程上设置事务超时时间(以秒为单位):

com.ibm.tx.jta.TransactionManagerFactory.getTransactionManager().setTransactionTimeout(timeout);
英文翻译

Here is an example of obtaining the WebSphere Application Server transaction manager in order to set the transaction timeout (in seconds) on a thread,

com.ibm.tx.jta.TransactionManagerFactory.getTransactionManager().setTransactionTimeout(timeout);

huangapple
  • 本文由 发表于 2020年3月16日 22:51:19
  • 转载请务必保留本文链接:https://java.coder-hub.com/60708163.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定