• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Transactions in Tomcat

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 2166
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can i know is Tyrex good ? in the case of connection pooling and datasource ??
 
Bras cause cancer. And tiny ads:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic