I am building a web service that will need to access 3 databases.
Therefore, I need to use JTA to manage the transaction.
I am trying to apply JTA without using EJB, Is that possible?
My code is like this:
UserTransaction userTransaction = (UserTransaction)inititalContext.lookup("java:comp/UserTransaction");
Exception was encountered with at the userTransaction.commit() line, and the exception message is:
Caused by: javax.transaction.xa.XAException: JDBC driver does not support XA, hence cannot be a participant in two-phase commit. To force this participation, set the GlobalTransactionsProtocol attribute to LoggingLastResource (recommended) or EmulateTwoPhaseCommit for the Data Source = myDS
I have tried to change the transaction setting to EmulateTwoPhaseCommit, the same error happens after the restart.
When I try to change it to LoggingLastResource, WebLogic cannot start at all.
How can I do and is there anything I have done wrongly?
Thanks in advance.
Yes, I have 3 data sources through JNDI.
My DBMSes are all oracle, but of different versions, they are 8i, 10g and 11g.
I have tried to change the 11g's driver to oracle.jdbc.xa.client.OracleXADataSource, but the same error still appear.
By the way, I am using hibernate, so I have added the following properties into my 3 hibernate.cfg.xml files:
Appreciate your help.
Let me know if you need me to provide more information.