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"
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.OracleXA DataSource
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.setAutoCom mit(false)
>
Here is the stack trace:
>
[7/19/03 12:10:02:936 PDT] 587e316 SystemErr R strMsg =
java.sql.SQLExc eption: ORA-02089: COMMIT is not allowed in a
subordinate session
[...]
>
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.OracleXA DataSource
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.setAutoCom mit(false)
>
Here is the stack trace:
>
[7/19/03 12:10:02:936 PDT] 587e316 SystemErr R strMsg =
java.sql.SQLExc eption: ORA-02089: COMMIT is not allowed in a
subordinate session
[...]
Comment