Win a copy of liveProject: Protecting User Data with Spring Security and OAuth2 this week in the Spring forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

JTA in web component

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 1551
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
I can't beleive you just said that. Now I need to calm down with this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic