• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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 ??
 
PI day is 3.14 (march 14th) and is also einstein's birthday. And this is merely a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic