• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • 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 ??
 
There were millions of the little blood suckers. But thanks to this tiny ad, I wasn't bitten once.
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic