XA transaction involving resources from different networks
I have a stand-alone application that talks to several EJBs on a Glassfish v2ur2 server. The stand-alone application obtains a UserTransaction to group several EJB method calls together.
Everything works fine when I run my application in the development environment where everything is on the same network. However, when the project is deployed to the production environment where the Glassfish sever and the client are now on different networks I got a connection time-out exception when the client tries to call the commit() method of the UserTransaction object.
From what I can tell, the commit request was received by the Glassfish server. But when the server tries to send out a commit acknowledgment (I think that's what the server is trying to send), it sends it to a private IP (192.168.0.x). That explains why the client can never receive the acknowledgment in the production environment.
My question is, why is the server sending information to a private IP? Is there a way that I can correct this?
My current work-around is to use container-managed transaction. However I really want to have my client application control the transaction boundary for flexibility. Or is it a bad practice that should not be used at all?
Any comment is appropriated.