Re: Oracle JDBC, SQLException, COMMIT is not allowed in a subordinate session

From: Anonymous <qcircuit_at_yahoo.com>
Date: 20 Jul 2003 12:52:24 -0700
Message-ID: <3cef1aeb.0307201152.3cbf4de3_at_posting.google.com>


I resolved this issue.

If you are using an Oracle XA DataSource, Oracle's JDBC driver will automatically issue a COMMIT when it sees a "DROP TABLE foobar" statement.

Oracle's JDBC driver cannot properly execute a DROP TABLE statement unless you are using a non-XA DataSource.

With the non-XA Oracle JDBC DataSource, I can happily execute "DROP TABLE foobar"

> My configuration:
>
> 1) IBM Websphere 5.0.2
> 2) database: Oracle9i release 2
> 3) Oracle JDBC DataSource, with XA enabled
> 4) driver class: oracle.jdbc.xa.client.OracleXADataSource
> 5) a servlet that uses JTA UserTransaction's
>
> When I execute "DROP TABLE movies", the Oracle JDBC
> driver throws a SQLException.
>
> The exception message is
>
> ORA-02089: COMMIT is not allowed in a subordinate session
>
> Oracle's documentation says:
>
> {{
>
> ORA-02089: COMMIT is not allowed in a subordinate session
>
> Cause: COMMIT was issued in a session that is not the two-phase commit
> global coordinator.
>
> }}
>
> The strange thing is that I my code does not issue a COMMIT
>
> Also, I disabled autocommit by calling
>
> conn.setAutoCommit(false)
>
> Here is the stack trace:
>
> [7/19/03 12:10:02:936 PDT] 587e316 SystemErr R strMsg =
> java.sql.SQLException: ORA-02089: COMMIT is not allowed in a
> subordinate session
> [...]
Received on Sun Jul 20 2003 - 21:52:24 CEST

Original text of this message