Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Transaction Attribute

 
Grishma Dube
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Suppose I've 4 transactions...if any error occurs i want to roll back 1,2 and 4th transaction to rollback but not the 3rd one...how can i achieve this?

Is it possible to do so? if yes,which transaction attribute, i should specify?

TAI

Grishma
 
sawan parihar
Ranch Hand
Posts: 250
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Yes you can do this by starting a new transaction from 3. like suppose we have function f1 transaction t1
f1(){
f2();--> joins t1
f3()--->Start a new transaction here

f4()---> joins t1

}

you can give transaction attributes accordingly..

cheers
 
Grishma Dube
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if i specify RequireNew attribute for third transaction will it work??



TAI

Grishma
 
sawan parihar
Ranch Hand
Posts: 250
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes specify transaction attribute as RequiresNew and it will start a new transaction and let other transactions join the existing one.



cheers.
 
Grishma Dube
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx a lot
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!