I am currently trying to control a Container managed transaction on one joboss server from within an EJB on a different Jboss server. I don't want to set up the whole Corba distributed transaction thing. I have read that you can do a jndi lookup on the UserTransaction object on the remote server and this will return a UserTransaction which you can begin, commit and rollback etc, The remote server EJB will inherit the transactional context, and "hey presto" you have a distributed transaction.
This works fine when the Controlling server hosting the EJB starting the transaction is OpenEjb and the Server we are getting the UserTransaction object from is (obviously) Jboss. But when both servers are Jboss it doesn't work. Bith Client and Server in this case are running on Jboss 4.2.3GA
The Client an EJB has some code like.
Context ctx = new InitialContext(properties);
ClientUserTransaction userTx = (ClientUserTransaction) ctx.lookup("UserTransaction");
This all works fine within an OpenEjb container, we can use userTx as a org.jboss.tm.usertx.client.ClientUserTransaction to begin, rollback and commit. and it will do so on any remote calls to EJBs .
The problem however the very same code does not return a org.jboss.tm.usertx.client.ClientUserTransaction object when run in another Jboss server, it returns a different implementation of a UserTransaction (org.jboss.tm.usertx.client.ServerVMClientUserTransaction) which does not work, and has no effect on the transactional context of calls to remote EJBs
It seems like when we call lookup Usertransaction it somehow determines what type of caller you are and returns a different object. I assume this is some behaviour of ClientUserTransaction MBean, which intercepts the jndi lookup. But I don't quite understand why.
My next step is to look into Configuration of ClientUserTransaction Mbean
Im a bit stumped Any ideas would be much appreciated...