Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTA in web component

 
sowmya thiru
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Section: 8.5 of SUn J2EE tutorial on JTA in Web components
"Calling UserTransaction.begin associates the calling thread with a new
transaction context. Subsequent accesses of transactional resources such as JDBC
connections or resource adapter connections implicitly enlist those resources into
the transaction. The call to UserTransaction.commit commits the transaction,
transparently engaging the two-phase commit protocol if necessary."
Scenario:
In my web component code (jsp/servlet), i get usertxn using jndi , and begin txn, put some vaue to sesssion, and call JDBC connection.
MyQuestion: If i get sql exception during my jdbc call and txn rollbacks, will the value added to session gets rolled back?
 
Rufus BugleWeed
Ranch Hand
Posts: 1551
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your question is vague. IMO no, things you add to a HttpSession during a transaction will not be removed from the session. You might be able to code this functionality with session attribute listeners. It maybe that certain vendors provide this functionality.
I don't feel it would be out of place to cross post this in the J2EE forum.
[ August 19, 2003: Message edited by: Rufus BugleWeed ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic