-
1. Re: Setting up a resource manager to work with Arjuna
tomjenkinson May 10, 2012 4:25 AM (in response to ksreen)Hi Kamala,
I must confess I am not altogether clear on what you are trying to achieve? It sounds almost like a JCA question? You are trying to plug in an RM into AS7? I think the part of the question that is really throwing me is "platform specific/proprietary transaction manager", are you able to elaborate?
Thanks!
Tom
-
2. Re: Setting up a resource manager to work with Arjuna
ksreen May 10, 2012 4:39 AM (in response to tomjenkinson)Hi Tom,
I have Jboss AS 7 with Arjuna and Arjuna will be the global transaction manager. I have another transaction manager on the platform which I want to act as a resource manager/local transaction manager. I would like to configure in such a way that when a transaction is started by say an ejb, Arjuna will start a JTA transaction which has to result in a local transaction on my TM. Arjuna will be the transaction coordinator and when Arjuna gives a commit or a roll back my TM commit or Rollback appropriately.
My TM on the platform already has extended the javax.transaction.xa.XAResource class.
I need to how what are the configuration parameter to be set in domain.xml and do I need anything specific in Ajuna configuration.
Regards
Kamala
-
3. Re: Setting up a resource manager to work with Arjuna
mmusgrov May 10, 2012 6:15 AM (in response to ksreen)1 of 1 people found this helpfulYou would need to get hold of the arjuna transaction manager and manually enlist your TM which would appear as an XA resource to the arjuna transaction manager. Do you need to do this whenever any JTA transaction is started or do you have more control over when you would need to do it?
-
4. Re: Setting up a resource manager to work with Arjuna
tomjenkinson May 10, 2012 6:20 AM (in response to mmusgrov)I think Mike is right, but an alternative to take care of that would be to write a JCA plugin, although you would need to ask on the Iron Jacamar forums for that. Probably the easiest thing would be to write a datasource for the external transaction manager and use similar config to the h2 configuration.Also, you would need to register an XA recovery helper so we can scan your external recovery manager for orphan XIDs.
Finally, is it possible to configure JTS for the external transaction manager?
-
5. Re: Setting up a resource manager to work with Arjuna
tomjenkinson May 10, 2012 6:20 AM (in response to tomjenkinson)PS reason I suggested the JCA plugin is it should take care of a requirement to "do this whenever any JTA transaction is started"
-
6. Re: Setting up a resource manager to work with Arjuna
ksreen May 10, 2012 6:22 AM (in response to mmusgrov)Hi Michael,
I would have to do it when ever a JTA transaction is started.
Can you elaborate on "need to get hold of the arjuna transaction manager and manually enlist your TM". Do you mean I would have to so something like
tm.begin();
tm.getTransaction().enlistResource(RS1);
Regards
Kamala
-
7. Re: Setting up a resource manager to work with Arjuna
ksreen May 10, 2012 6:25 AM (in response to tomjenkinson)Hi Tom,
Is it easier if JTS can be configured. Can you elaborate how? Also, can you recommend me a good tutorial to get started on JCA?
Regards
Kamala
-
8. Re: Setting up a resource manager to work with Arjuna
tomjenkinson May 10, 2012 6:47 AM (in response to ksreen)1 of 1 people found this helpfulWell, JTS is designed for interoperation between heterogeneous server environments using IIOP, so if your other server supports JTS that is definitely an avenue to pursue. AS7 supports JTS.
In terms of JCA, I would point you at: https://community.jboss.org/en/ironjacamar?view=discussions
Note that "distributed JTA" which is what you sound like you were originally trying to set up is a tough task to get right in the presence of failure. I think you would be better off trying to get JTS working (assuming you are using EJB).
That said, not all JTS implementations do interop well, can you elaborate on the other server in the picture?
-
9. Re: Setting up a resource manager to work with Arjuna
ksreen May 10, 2012 11:04 AM (in response to tomjenkinson)Hi Tom,
Actually it is not possible to configure JTS for the external transaction manager. Hence would ahve to check of Iron Jacamar has any feature to specify a xa-resource just like a it has for xa-datasource.
Thanks and Regards
Kamala
-
10. Re: Setting up a resource manager to work with Arjuna
tomjenkinson May 10, 2012 11:11 AM (in response to ksreen)Sure, don't forget my point about recovery too. We do have a version of what you need but for own transaction manager: https://anonsvn.jboss.org/repos/labs/labs/jbosstm/branches/JBOSSTS_4_16/atsintegration/examples/classes, you could try to take a look at that.
-
11. Re: Setting up a resource manager to work with Arjuna
ksreen May 11, 2012 3:10 AM (in response to tomjenkinson)Hi Tom and Micheal,
In weblogic server there is a way to register a XA Resource.(http://docs.oracle.com/cd/E13222_01/wls/docs70/jta/resource.html#1063419) Is there an equivalent Arjuna.
What are the equivalents of
1) TransactionManager tm = TxHelper.getTransactionManager();
2) tm.registerStaticResource(name, res);
3)Transaction tx = TxHelper.getTransaction();
tx.enlistResource(res);Assuming resource is my javax.xa.XAResource.
Thanks and Regards
Kamala
-
12. Re: Setting up a resource manager to work with Arjuna
tomjenkinson May 11, 2012 3:52 AM (in response to ksreen)1. Get the TransactionManager through JNDI:
TransactionManager tm = new InitialContext().lookup("java:/TransactionManager");
2. Not supported - not clear what this is used for
3. Get the Transaction from the tm: http://docs.oracle.com/javaee/5/api/javax/transaction/TransactionManager.html
Transaction tx = tm.getTransaction();
Enlist the resource using JTA: http://docs.oracle.com/javaee/5/api/javax/transaction/Transaction.html
tx.enlistResource(res);
You will need to register a recovery helper with Arjuna so we can scan it for indoubt transactions, see my referenced https://anonsvn.jboss.org/repos/labs/labs/jbosstm/branches/JBOSSTS_4_16/atsintegration/examples/classes for an example.
Tom