wood burning stoves 2.0*
The moose likes Servlets and the fly likes TX in servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "TX in servlets" Watch "TX in servlets" New topic

TX in servlets

Hussein Baghdadi
clojure forum advocate

Joined: Nov 08, 2003
Posts: 3476

My web application uses DataSource as the interface of database operations.
My servlet has to group the following operation in a single transaction :
// insert new record in table1
// insert new record in table2
// update a row in table3
How to use transaction here ?
Should I use TransactionManager (JTA) ? or use original transaction like setAutoCommit( ) ?
In the case if I have to use JTA, I have to put jta.jar in Tomcat classpath, right ?
Ganesh Gowtham
Ranch Hand

Joined: Mar 30, 2005
Posts: 225

Hi todd..

i think if u use small TX better go for the SetCommit();
at last once all the Tx are sucess else roll back i think as far as my knowledge and expis concerned if u have time and ur appln extends more ..its reallly better t use JTA...

Let me know if it is OK

Thx and Regards
G R Ganesh Gowtham
Capricornsys inc, Hyderabad

Thanks, Ganesh Gowtham
subject: TX in servlets
Similar Threads
UserTransaction and DB transaction
Transaction Locking Question
Make hibernate use JTA transaction in WAS 5.1
JTA query