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

From: Jim Kennedy <kennedy-down_with_spammers_at_no_spam.comcast.net>
Date: Sat, 19 Jul 2003 19:36:17 GMT
Message-ID: <R4hSa.99375$Ph3.11829_at_sccrnsc04>


ALL DDL does a commit. Hence Drop Table movies; issues a commit. True you don't issue a commit and the driver does not issue a commit, but the server does for all DDL.
That is probably where your commit is coming from. Jim

-- 
Replace part of the email address: kennedy-down_with_spammers_at_attbi.com
with family.  Remove the negative part, keep the minus sign.  You can figure
it out.
"Anonymous" <qcircuit_at_yahoo.com> wrote in message
news:3cef1aeb.0307191124.21f016a4_at_posting.google.com...

> 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
>
>
> at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
>
> at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
>
> at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:579)
>
> at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1894)
>
> at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1094)
>
> at
oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2132 )
>
> at
oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:2015)
>
> at
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java :2877)
>
> at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:925)
>
> at
com.ibm.ws.rsadapter.jdbc.WSJdbcStatement.execute(WSJdbcStatement.java:299)
>
> at foobar.movie.MovieUtil.setupMovieTable(MovieUtil.java:66)
Received on Sat Jul 19 2003 - 21:36:17 CEST

Original text of this message