Search code examples
jbosstransactionsjmxjta

How to change value of com.arjuna.ats.jbossatx.jta.TransactionManagerService TransactionTimeout at the run-time? continued


I asked this question earlier How to change value of com.arjuna.ats.jbossatx.jta.TransactionManagerService TransactionTimeout at the run-time?

As per the answer provided I found this java code to do my job:

MBeanServer mBeanServer = MBeanServerLocator.locateJBoss();
TransactionManagerDelegate tmd = (TransactionManagerDelegate) mBeanServer.getAttribute(new ObjectName("jboss:service=TransactionManager"), "TransactionManager");
System.out.println("Prev: " + tmd.getTransactionTimeout());
tmd.setTransactionTimeout(200);
System.out.println("New: " + tmd.getTransactionTimeout());

Now here is the problem... the code executes fine but when i check from JMX-console the Transaction Timeout is still the same.

When i debug i found that TM instance fetched from mBeanServer and TM instance available on jmx-console are different!

Is there any way to update the TM instance which is available on JMX-Console?


Solution

  • The code above works and does change the transaction timeout. As @Nicholas mentioned They are different object instances, but there is only one transaction manager.

    however The value reported in the MBean's TransactionTimeout attribute doesn't change

    and this caused me to ask this question on the first place.