aspose file tools
The moose likes EJB and Other Java EE Technologies and the fly likes rollback in CMP Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » EJB and Other Java EE Technologies
Reply Bookmark "rollback in CMP" Watch "rollback in CMP" New topic
Author

rollback in CMP

syed mraza
Greenhorn

Joined: Aug 23, 2001
Posts: 25
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

Joined: Aug 10, 2001
Posts: 3878
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.


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
 
IntelliJ Java IDE
 
subject: rollback in CMP
 
Threads others viewed
strange error causing JVM to hang..???
transaction rolling back
Error Deleting Persisted Objects: Hibernate/MySQL
how to rollback a distributed transation
Two transactions in one CMP MDB