+2  A: 

Questions to ask yourself/team:

  1. Does our database support XA?
  2. Does the JDBC driver support XA?
  3. Will the combination of Glassfish/database/JDBC work with XA?
  4. Do we really need distributed transactions?

I'll return to point 4 - don't do distributed transactions. You need to be really sure that distributed transactions are the best solution for you. It isn't simple and the recommendation is to avoid them, if possible. This comes straight from Jürgen Höller, co-founder and senior developer at Spring.

Spring has no support for propagating transactions between processes, so you'll need the container to support this or manually do this yourself.

hbunny
Well, I am not sure I need distributed transactions, but how can I provide a solution, where you could call E1 (which internally calls Base) and Base, for eg. on a WebService, and maintain atomicity?
pihentagy
One approach (and I don't know if this fits your problem domain or not) is to use asynchronous message passing - the definitive work on this is http://www.enterpriseintegrationpatterns.com/
hbunny
Have not looked into it, but will it allow me to cooperate applications to decide an outcome (commit/rollback) of a complex (multi-application) action? It seems to be a solution for a system with loosely coupled applications.
pihentagy
Will not use distributed transactions. Everything will go to one war file.
pihentagy