Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Transactions in Tomcat

 
N Naveen
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can i know is Tyrex good ? in the case of connection pooling and datasource ??
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic