I have an application deployed in Tomcat with backend oracle and JPA as persistence manager. Now we are introducing an intermediate database (most probably SolidDB or TimesTen) which will bring an additional requirement of 2 phase commit. Since tomcat does not support J2EE we wont be able to use the conventional methods. How about using Atomikos. Is there any other transaction management system which supports tomcat. Our application will have a peak load of say 40 million records in a day. Will using Atomikos be reliable? Any other suggestions are welcome.
-
It might be terminology confusion but most DBMS such as Oracle implements two phase commit (2PC) – gerrytan Jul 15 '13 at 07:30
-
I need to implement 2PC for 2 different DBs say Oracle and Solid DB. So built in 2PC in oracle might not work – Kailas J C Jul 15 '13 at 08:52
-
I think the better terminology for your case is distributed transaction (multi resource transaction) – gerrytan Jul 15 '13 at 12:55
2 Answers
There are a few options for standalone JTA,
See, Atomikos vs JOTM vs Bitronix vs?
You should also consider using a Java EE server.
For EclipseLink, it has support for JOTM, and most Java EE servers. To integrate with another you just need to subclass JTATransactionController.
One solution is implemented without using Atomikos or JOTM or Bitronix. It is by using AOP along with JPA. We are defining 2 entity manager factories and 2 transaction managers. Using Spring AOP we are applying both the transaction managers to the same function. So whenever an exception comes, the rollbacl will be done by the 2 transaction managers. It is explained in the link given below http://tiwarij2eeblog.blogspot.com/2010/12/handling-transaction-with-multiple.html

- 139
- 3
- 8
-
The solution described does not work correctly. One of two transaction will be committed before another and if the second commit fails the first transaction is not rolled back. – Roman-Stop RU aggression in UA Oct 27 '13 at 21:25