Hibernate version: 3
Spring 2 with spring JTA transaction manager
[c] Java 1.5 [/c]
[d] Oracle 9g with XA enabled [/d]
Hi,
We have 4 lossely coupled applications that are independent except that at certain points they provide services or use services of other applications. Every application has its own database schema and uses a seperate session factory defined in its own application context. The business methods are wrapped by transactions with taget= PROPAGATION_REQUIRED. We use spring JTA transactions.The different datasources uses XA datasources. The problem that we are having is that if we invoke services of an application that uses a single datasource i.e. is own everything works fine. But if we try to invoke a service that makes calls to other applications and therefore span multiple datasources the transaction is inititated in the caller but at the point where a call to a read/write is involved to another datasource the transaction does not propagate and we get an error "could not invoke transaction on meta ware object"--And the stack trace shows problem at OracleXAResourceManager could not start transaction. I dont know if enabling xid in jboss will serve the problem or whether we are using XA transactions propely. Our oracle server is XA enabled. We tried to switch to local datasorces and we have the same problem. Im certain that if there was only one schema and one datasource PROPAGATION_REQUIRED would have worked. Im not soure how to solve this promblem. I tried googling and came up with almost nothing. It seems to me that most people prefer to seperate the transaction boundaries instead of using distributed transactions and use something like a command pattern for undo/rollback. This means that they seperate the methods instead of having one monolethic method that spans multiple datasources. However I would like to have a go at XA datasources and distributed transactions.
Regards,
Conrad
|