Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

rollback in CMP  RSS feed

 
syed mraza
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all
i'm using 2 different CMP methods in a same method and want to rollback the transaction should any thing wrong occurs. using "required" as transaction attribute for 1st CMP and "mandatory" for hte 2nd. now whts happening tht if any sql related error comes (like duplicate key found, data mismatch etc) then it roll backs correctly. but if some other error comes like number format exception etc thn it commits instead of rollback.
any help woudl realy be appriciated. thnx in advance.
rgds
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, you could set up a generic "try...catch..." block for Exception in your method, and then do a setRollbackOnly() inside the catch block...
Kyle
------------------
Kyle Brown,
Author of Enterprise Java (tm) Programming with IBM Websphere
See my homepage at http://members.aol.com/kgb1001001 for other WebSphere information.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!