标题翻译
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);
专注分享java语言的经验与见解,让所有开发者获益!
评论