Xref: alice comp.databases.oracle:76767 comp.databases.oracle.misc:49108 comp.databases.oracle.server:77514
Path: alice!news-feed.fnsi.net!enews.sgi.com!paloalto-snf1.gtei.net!news.gtei.net!inet16.us.oracle.com!not-for-mail
From: Thomas Kyte <tkyte@us.oracle.com>
Newsgroups: comp.database.oracle.server,comp.databases.oracle,comp.databases.oracle.misc,comp.databases.oracle.server,comp.lang.java.databases,comp.lang.java.help,comp.lang.java.programmer
Subject: Re: JDBC / stored procedures / transaction/ rollback capability
Date: Sun, 12 Dec 1999 15:28:48 -0500
Organization: Oracle Service Industries
Lines: 38
Message-ID: <m8185s8s1ootavqmo05ovi1pemoancmo6r@4ax.com>
References: <A5F44.751$ds3.18574@news1.alsv1.occa.home.com>
Reply-To: tkyte@us.oracle.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: inet16.us.oracle.com 945030569 18903 130.35.34.225 (12 Dec 1999 20:29:29 GMT)
X-Complaints-To: usenet@inet16.us.oracle.com
NNTP-Posting-Date: 12 Dec 1999 20:29:29 GMT
X-Newsreader: Forte Agent 1.7/32.534

A copy of this was sent to "CaboDog" <cabodog@home.com>
(if that email address didn't require changing)
On Sun, 12 Dec 1999 04:00:32 GMT, you wrote:

>From my Java program, I want to call stored procedures on an Oracle database
>that perform inserts to tables.  If I call more than one of these stored
>procedures in succession (using JDBC callable statements) inside a
>transaction wrapper (in other words, I execute 2 or more of these insert
>stored procedures before committing) across the same connection in my Java
>program, if I issue a rollback, will everything that those stored procedures
>have done be rolled back, or is the only possible thing that can be rolled
>back in JDBC dynamic sql?
>

As long as the connection is not set to autocommit (eg:

    DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
    oracleConnection = DriverManager.getConnection(...);
    oracleConnection.setAutoCommit(false);

)

and the stored procedures do not commit themselves, a rollback will rollback
both of them.


>Brad
>


-- 
See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'...
Current article is "Part I of V, Autonomous Transactions" updated June 21'st
 
Thomas Kyte                   tkyte@us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation
