This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes CMT  - Retry logic with setRollBackOnly() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "CMT  - Retry logic with setRollBackOnly()" Watch "CMT  - Retry logic with setRollBackOnly()" New topic

CMT - Retry logic with setRollBackOnly()

Joe JosephK

Joined: Dec 14, 2009
Posts: 1

I have a CMT in which i do sessionCtx.setRollbackOnly() in case of a DBException (Deadlock) and throw back a BusinessException
And the client code does a retry as below:

MyBean beanProcessor = MyHome.create();
int i = 0;
for(; i < retryMaxNum; i ++){
catch (BusinessException e)

As you see i use the same Bean instance (on which the rollback was applied) in the retry case.
Do you see any problem in this approach???

Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

No, that should work.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: CMT - Retry logic with setRollBackOnly()
It's not a secret anymore!