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

From: Jim Kennedy <kennedy-downwithspammersfamily_at_attbi.net>
Date: Sun, 20 Jul 2003 20:11:14 GMT
Message-ID: <CHCSa.94182$wk6.25824_at_rwcrnsc52.ops.asp.att.net>


The commit is NOT issued by the driver; it is issued by the database. Log in to sqlplus and prove it to yourself.
eg
update something
drop a table
rollback
and the update will not be rolled back.
Jim
"Anonymous" <qcircuit_at_yahoo.com> wrote in message news: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 - 22:11:14 CEST

Original text of this message