JCA Adapter & Recovery
maxant Jun 27, 2013 11:06 AMI have written my own resource adapter and it is bound into XA transactions perfectly. during testing I want to see if the transaction manager can recover an unfinished transaction, so during the call to the XAResource#commit(Xid, boolean) method I kill the JVM.
When JBoss AS is started again, I get the following two lines of log every ~2 minutes, but the transactions are recovered. I was expecting the commit method to be called again.
20:24:54,360 WARN [com.arjuna.ats.jta] (Periodic Recovery) ARJUNA016037: Could not find new XAResource to use for recovering non-serializable XAResource XAResourceRecord < resource:null, txid:< formatId=131077, gtrid_length=29, bqual_length=36, tx_uid=0:ffff0a10be5e:5ac60acf:51cc48ab:1f, node_name=1, branch_uid=0:ffff0a10be5e:5ac60acf:51cc48ab:21, subordinatenodename=null, eis_name=java:/eis/SAPResourceAdapter >, heuristic: TwoPhaseOutcome.FINISH_OK, product: SAP Resource Adapter/1.0, jndiName: java:/eis/SAPResourceAdapter com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord@8bd6e74 >
20:24:55,629 WARN [com.arjuna.ats.jta] (Periodic Recovery) ARJUNA016038: No XAResource to recover < formatId=131077, gtrid_length=29, bqual_length=36, tx_uid=0:ffff0a10be5e:5ac60acf:51cc48ab:1f, node_name=1, branch_uid=0:ffff0a10be5e:5ac60acf:51cc48ab:21, subordinatenodename=null, eis_name=java:/eis/SAPResourceAdapter >
In the ironjacamar docs I read that I need to implement org.jboss.jca.core.spi.recovery.RecoveryPlugin, so I made my ResourceAdapter do that, and added it to ironjacamar.xml, which is in the META-INF folder of my Resource Archive, which is inside an EAR.
<?xml version="1.0" encoding="UTF-8"?>
<ironjacamar>
<connection-definitions>
<connection-definition
class-name="ch.maxant.jca_demo.sapresourceadapter.SAPManagedConnectionFactory"
jndi-name="java:/eis/SAPResourceAdapter">
<recovery>
<recover-plugin class-name="ch.maxant.jca_demo.sapresourceadapter.SAPResourceAdapter" />
</recovery>
</connection-definition>
</connection-definitions>
</ironjacamar>
What do I have to do, in order for the transaction manager to call my resource adapter to commit the unfinished transaction?
I'm using JBoss AS 7.1.0.Final
Thanks,
Ant