aspose file tools*
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 8 in Action this week in the Java 8 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
Similar Threads
can we use tx in servlets ?
Connection from DataSource only allows "selects"!
Transcation management at DO level using spring jdbc framework
Facing Issue while spring transaction roll back.
Problem in Two-phase Commit