472,353 Members | 1,351 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

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

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
[...]
Jun 27 '08 #1
3 12646
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" <qc******@yahoo.comwrote in message
news:3c**************************@posting.google.c om...
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
[...]

Jun 27 '08 #2
Gentlemen,

To add a more general level to this thread: in Oracle *all* ddl statements have
an implied commit associated to them. That is: any creation, removal or change
of a database object forces a commit on the current transaction.

Regards,

Ruud de Koter.

Jim Kennedy wrote:
>
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" <qc******@yahoo.comwrote in message
news:3c**************************@posting.google.c om...
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
[...]
--
--------------------------------------------------------------------------------------
Ruud de Koter HP OpenView Software Business Unit
Senior Software Engineer IT Service Management Operation
Telephone: +31 (20) 514 15 89 Van Diemenstraat 200
Telefax : +31 (20) 514 15 90 PO Box 831
Telnet : 547 - 1589 1000 AV Amsterdam, the Netherlands
Email : ru**********@hp.com

internet: http://www.openview.hp.com/products/servicedesk
intranet: http://ovweb.bbn.hp.com/itservicemanager
--------------------------------------------------------------------------------------
Jun 27 '08 #3
Gentlemen,

To add a more general level to this thread: in Oracle *all* ddl statements have
an implied commit associated to them. That is: any creation, removal or change
of a database object forces a commit on the current transaction.

Regards,

Ruud de Koter.

Jim Kennedy wrote:
>
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" <qc******@yahoo.comwrote in message
news:3c**************************@posting.google.c om...
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
[...]
--
--------------------------------------------------------------------------------------
Ruud de Koter HP OpenView Software Business Unit
Senior Software Engineer IT Service Management Operation
Telephone: +31 (20) 514 15 89 Van Diemenstraat 200
Telefax : +31 (20) 514 15 90 PO Box 831
Telnet : 547 - 1589 1000 AV Amsterdam, the Netherlands
Email : ru**********@hp.com

internet: http://www.openview.hp.com/products/servicedesk
intranet: http://ovweb.bbn.hp.com/itservicemanager
--------------------------------------------------------------------------------------
Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Paul | last post by:
hi, i'm getting the following error when i try to run the code below to connect to an oracle db: ...
3
by: David | last post by:
Hello all, I have been trying to use the OCI driver to connect to Oracle 9i, but have been getting the following error: java.sql.SQLException:...
0
by: JWM | last post by:
I am trying to implement Oracle connection pooling for the following code, which was written by someone else. Here is my main question -- this java...
11
by: Markus Breuer | last post by:
I have a question about oracle commit and transactions. Following scenario: Process A performs a single sql-INSERT into a table and commits the...
19
by: Gregor =?UTF-8?B?S292YcSN?= | last post by:
Hi! I'm using DB2 database on one server and ORACLE database on the second one. I want to move some data from ORACLE database to DB2 database and...
2
by: Vinod Sadanandan | last post by:
All, Below listed are the new features in Oracle 11g ,please join me in this discussion to generate a testcase and analyze...
1
by: wnaveenkumar | last post by:
package com.trewport.orderprocess.action; import java.io.*; import java.sql.*; import java.util.*; import java.util.Date; import...
0
by: neuraljay | last post by:
hi everyone. I am trying to build a jsp using webwork, hibernate and mysql. And right now I am doing its unit testing. Everytime I run the test I am...
0
by: Jim Kennedy | last post by:
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...
0
by: Edoardo | last post by:
thanks guys, I was hoping to be able to get the info from some method on oracle's own jdbc implementation classes, as both suggestion to use these...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.