This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes setRollbackOnly() doesn't work Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "setRollbackOnly() doesn Watch "setRollbackOnly() doesn New topic

setRollbackOnly() doesn't work

ravinderSingh singh
Ranch Hand

Joined: Nov 18, 2004
Posts: 41
Hi all,

I'm using an Oracle database and Weblogic server. However, when I execute the following code (which is contained within an ejb session bean method):

... the insert statement is not rolled back even though I explicitly call setRollbackOnly().

Could anyone help?
Roger Chung-Wee
Ranch Hand

Joined: Sep 29, 2002
Posts: 1683
What does your DD look like?

SCJP 1.4, SCWCD 1.3, SCBCD 1.3
Sanjeev Verma
Ranch Hand

Joined: Aug 24, 2000
Posts: 87
Sun says - "Only enterprise beans with container-managed transactions are allowed to use this method." - is your bean marked as container-managed?
ravinderSingh singh
Ranch Hand

Joined: Nov 18, 2004
Posts: 41
I'm using container managed transactions.

The DD entry is as follows:


Any suggestions ... ?
I agree. Here's the link:
subject: setRollbackOnly() doesn't work
It's not a secret anymore!