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
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 ... ?
It is sorta covered in the JavaRanch Style Guide.
subject: setRollbackOnly() doesn't work
Similar Threads
Facing Issue while spring transaction roll back.
Transcation management at DO level using spring jdbc framework
Connection from DataSource only allows "selects"!
can we use tx in servlets ?
Problem in Two-phase Commit