Re: JDBC / stored procedures / transaction/ rollback capability

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: 1999/12/12
Message-ID: <m8185s8s1ootavqmo05ovi1pemoancmo6r_at_4ax.com>#1/1


A copy of this was sent to "CaboDog" <cabodog_at_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_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation
Received on Sun Dec 12 1999 - 00:00:00 CET

Original text of this message