-
1. Re: How does JbossTS work if a cluster instance goes down while handling a distributed transaction?
prakkarp Feb 22, 2012 8:36 AM (in response to prakkarp)I am using JBoss EAP 5.1.0
-
2. Re: How does JbossTS work if a cluster instance goes down while handling a distributed transaction?
paul.robinson Feb 22, 2012 8:50 AM (in response to prakkarp)1 of 1 people found this helpfulPrakash,
Each node in your cluster has it's own object store. Therefore, you will need to recover the failed node, in order for the recovery manager to recover the in-flight transactions. There may be some tricks you can pull, by putting the object store on shared storage, but you will need to ensure that two nodes are not using the object store at the same time. I'm not sure what we support in this area, maybe someone else on the TS team can elaborate?
Paul.
-
3. Re: How does JbossTS work if a cluster instance goes down while handling a distributed transaction?
prakkarp Feb 22, 2012 9:00 AM (in response to paul.robinson)Hi Paul,
Thanks for the quick response.
Is there some other way to do this? Basically what i want to achieve is that the transaction recovery should be handled by one of the other instances in the cluster.
Putting the object store into a common location would be problematic as it will not be possible to prevent the nodes from using the object store at the same time.
Prakash
-
4. Re: How does JbossTS work if a cluster instance goes down while handling a distributed transaction?
mmusgrov Feb 22, 2012 9:15 AM (in response to prakkarp)Each transaction manager is assigned a node identifier and these are embedded in the recovery logs. Normally the recovery system recovers logs records on the same node it is running on but it is possible to tell the recovery manager which nodes it is allowed to recover. But I think the property setting is only read at startup so if you wanted another node to recover transactions started elsewhere you would need to restart it.
-
5. Re: How does JbossTS work if a cluster instance goes down while handling a distributed transaction?
jhalliday Feb 22, 2012 9:23 AM (in response to prakkarp)1 of 1 people found this helpfulautomatic proxy recovery is not implemented, much less supported. Vote for JBTM-312 if you want it.
-
6. Re: How does JbossTS work if a cluster instance goes down while handling a distributed transaction?
prakkarp Mar 14, 2012 6:48 AM (in response to mmusgrov)Can you please let me know the name of the property which tells the recovery manager what nodes it is allowed to recover?
-
7. Re: How does JbossTS work if a cluster instance goes down while handling a distributed transaction?
tomjenkinson Mar 14, 2012 6:55 AM (in response to prakkarp)Hi Prakash:
JTAEnvironmentBean.xaRecoveryNodes
Best regards,
Tom
-
8. Re: How does JbossTS work if a cluster instance goes down while handling a distributed transaction?
jhalliday Mar 14, 2012 7:53 AM (in response to prakkarp)com.arjuna.ats.jta.xaRecoveryNode
(the beanification of the config came after EAP 5.1)
-
9. Re: How does JbossTS work if a cluster instance goes down while handling a distributed transaction?
prakkarp Mar 14, 2012 8:15 AM (in response to jhalliday)Thanks....I tried setting the value to "*" but recovery doesn't happen.
Here's my test scenario:
I have 2 instances in a cluster with both instances pointing to the same JDBCObjectStore. The jbossts-properties.xml of both instances are identical except for the com.arjuna.ats.arjuna.xa.nodeIdentifier which i set to 1 and 2 respectively for the 2 instances.
In my application i have a JTA transaction with 2 resources. After one resource gets committed i kill the instance so that there is an entry in the objectStore.
Then i bring up the other instance and check if the recovery manager is able to recover the transaction. The recovery doesn't happen in this case.
However If i kill and bring up the same instance, recovery happens.
-
10. Re: How does JbossTS work if a cluster instance goes down while handling a distributed transaction?
mmusgrov Mar 14, 2012 9:45 AM (in response to prakkarp)Have you configured the same set of XA resources on both instances. What do you see on the console when the other instances runs its recovery scan.
-
11. Re: How does JbossTS work if a cluster instance goes down while handling a distributed transaction?
prakkarp Mar 14, 2012 10:31 AM (in response to mmusgrov)Yes. Its the same resource configuration on both the instances.
To be more specific i use the JBoss Messaging XA Resource and a DummyXAResource are the two resources participating the transaction.
Here's code which shows what i do in the transaction.
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
try{
DummyXAResource dr = new DummyXAResource();
TransactionManager tm = TransactionManagerLocator.getInstance().locate();
JBossConnectionFactory jbf = (JBossConnectionFactory)factory;
String msg = request.getParameter("message");
boolean commit = false;
tm.begin();
Transaction tx = tm.getTransaction();
XAConnection connection = jbf.createXAConnection();
XASession session = connection.createXASession();
tx.enlistResource(dr);
tx.enlistResource(session.getXAResource());
MessageProducer sender = session.createProducer(queue);
TextMessage message = session.createTextMessage();
message.setJMSType("foo");
message.setText(msg);
sender.send(message);
tx.commit();
if (sender != null) try { sender.close(); } catch (Exception ignore) { }
if (session != null) try { session.close(); } catch (Exception ignore) { }
if (connection != null) try { connection.close(); } catch (Exception ignore) { }
}catch(Exception e)
{
e.printStackTrace();
}
}
Following is the message i get in the console in the other instance:
10:07:51,808 WARN [loggerI18N] [com.arjuna.ats.internal.jta.resources.arjunacore.norecoveryxa] [com.arjuna.ats.internal.jta.resources.arjunacore.norecoveryxa] Could not find new XAResource to use for recovering non-serializable XAResource < 131075, 26, 24, 504597101494952495158975356485852102544856534898585410297101494952495158975356485852102544856534898585551 >
-
12. Re: How does JbossTS work if a cluster instance goes down while handling a distributed transaction?
jwest Mar 15, 2012 10:34 AM (in response to prakkarp)Hi Prakash,
The problem is tha the JBossTS service doesn't have a reference to the DummyXAResource resource manager and therefore doesn't know how to recover it. This warning is commonly seen when recovering JMS resources in a cluster, and the recovery module has not been setup in jbossts-properties.xml. Take a look at section '7.5 JMS Clustering Nodes' in [1].