我们使用两个应用程序服务器,Jboss 和 Websphere (v8.5.5.11)。 我们在本地平台中使用jboss,但开发服务器使用Websphere。我想更改运行时的事务超时。在Jboss上工作正常,但在websphere上不行。如何为websphere线程设置事务超时。
JtaTransactionManager tm = (JtaTransactionManager) SpringApplicationContext.getContext().getBean(PlatformTransactionManager.class);
tm.getUserTransaction().setTransactionTimeout(timeout);
最佳答案
下面是获取 WebSphere Application Server 事务管理器以设置线程上的事务超时(以秒为单位)的示例,
com.ibm.tx.jta.TransactionManagerFactory.getTransactionManager().setTransactionTimeout(timeout);
关于java - Websphere Runtime事务超时问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60708163/