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?
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 ]
I can't beleive you just said that. Now I need to calm down with this tiny ad: