File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes Transactions in Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Transactions in Tomcat" Watch "Transactions in Tomcat" New topic

Transactions in Tomcat

N Naveen

Joined: Sep 04, 2003
Posts: 27
I am using Apache Tomcat.I am not using EJbs of course.And my database is MYSQL (InnoDb).I wish to use transactions in tomcat.How do i do that ?

1.Does Commons-DBCP enable transactions or does it achieve connection pooling only ?
2.I think TYREX does Transactions.Do i need to use a XADataSource or ordinary DataSource ? How does TYREX fare against JOTM ? Which is better and why ?
(I think I need DataSource only as i am not using 2 phase commit here).

If you do any answers,pls do let me know.
Thanks in advance for your answers,
Axel Janssen
Ranch Hand

Joined: Jan 08, 2001
Posts: 2164
if your transactions go against only one datasource, JDBC offers transaction support.
If you access more than one datasource in your transactions XADatasource is good thing. But it appears as if you only want to connect to 1 database.
N Naveen

Joined: Sep 04, 2003
Posts: 27
The solution isnt that good here.
In my business class,if i am making multiple calls to my dao layer,
if one of them fails ,i am supposed to rollback changes in all the other.
i am using datasources here for connection pooling and UserTransaction class for handling transactions.
N Naveen

Joined: Sep 04, 2003
Posts: 27
Can i know is Tyrex good ? in the case of connection pooling and datasource ??
I agree. Here's the link:
subject: Transactions in Tomcat
jQuery in Action, 3rd edition