Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A question about use of userTransaction and Connections

 
raminaa niilian
Ranch Hand
Posts: 551
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Thank you for reading my post
can some one please help me understand a scenario like this:

con1.setAutoCommit(false)
con2.setAutoCommit(false)

{
utx.begin()
.....
....
con1.commit();
con2.commit();


utx.rollback();

I need to rollback even commited connections if my utx rolled back, is it doable?

thanks
 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you are using a user transaction, then you should not call commit/rollback on individual resources.
You should only call commit/rollback on the user transaction object.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic