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

TX in servlets

 
Hussein Baghdadi
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.
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 ?
Thanks.
 
Ganesh Gowtham
Ranch Hand
Posts: 225
IBM DB2 Eclipse IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
grgowtham_cse@yahoo.com
Capricornsys inc, Hyderabad
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic