File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Cross JVM transactions - Architecture issues Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Cross JVM transactions - Architecture issues" Watch "Cross JVM transactions - Architecture issues" New topic

Cross JVM transactions - Architecture issues

Alok Pota
Ranch Hand

Joined: Mar 07, 2001
Posts: 185
I have 3 JVMs (a,b,c) of which JVM-a is the server JVM (say), the server JVM has a transaction manager that keeps tracks of all the local transactions, local connection pools and the resources (connections) it doles out to the other JVMs (b & c) which I call agents.
Agents need resources (connections to databases) which the server maintains. Agent b and c need 1 connection each, to different databases. Server therefore needs to simulate a 2-PC transaction.

Agents typically send a message to the server to ask for connection. The server doles out a connection, enlists it in a transaction and sends it to the agent. The agent then uses it to do its SQL work. Let say b and c operate sequentially, i.e b asks server to checkpoint then c asks server for connection and finally c signals server to commit.

The problem with all the above is that the JVMs communicate using JMS and I canot pass the enlisted java.sql.Connection around. The other approach would be to have the agents send all its workload to the server.
(some XML'ized SQL job). The server then executes it. The problem is that defeates the purpose of having an agent in the first place.
I don;t know how commercial transaction systems work acorss distributed JVMs. It would be intersting to know what folks experienced with theese issues have to say..
I agree. Here's the link:
subject: Cross JVM transactions - Architecture issues
It's not a secret anymore!