Quote:
looking for someone with more experience in this area then me to come to the rescue. No luck so far though.
Also I have the impression that the community using OPEN/XA with real distributed transactions over different JVMs
is really small.
Quote:
... two JVMs to share the same hibernate session and transaction
Hm, slowly I begin to doubt if hibernate or better JDBC allows this at all: obtain a connection to an already open-transaction ?
I believe that distributed transactions protocol provides only the possibility to issue the commit on the global transaction out from another JVM, but not to share JDBC-connections over different JVMs.
So probably you have really to use 2 separate XA-resources (one for each JVM) sharing the same database.
Quote:
From what I read about 2nd level caching is that any uncommited mutations I make on one JVM aren't sent to the cache on the second jvm until I commit, is this correct?
If you properly use JBossCache (Infinispan) as 2L cache with JTA-integration then this is correct.
If you use other 2L cache implementations like EHCache, then I don't know the answer.
N.B.: Given all troubles, I would seriously re-evalutate your first idea
-simply call flush for simulating the first phase commit on both sides using dirty-read isolation level and no version control.
It is not 100% sure that the commit afterwards succeds, but usually it does if defining constraints properly on db.
The communication between the 2 JVM you could realize through JMS or something other.
This allows you to get rid of the complex JTA and OPEN/XA approach, which is not easy to implement outside an application server with(out) transaction service.