wood burning stoves 2.0*
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
Author

Transactions in Tomcat

N Naveen
Greenhorn

Joined: Sep 04, 2003
Posts: 27
Hi,
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,
Naveen.N
Axel Janssen
Ranch Hand

Joined: Jan 08, 2001
Posts: 2164
if your transactions go against only one datasource, JDBC offers transaction support.
http://java.sun.com/docs/books/tutorial/jdbc/basics/transactions.html
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
Greenhorn

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
Greenhorn

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: http://aspose.com/file-tools
 
subject: Transactions in Tomcat