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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Anonymous

    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.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
    [...]
  • Jim Kennedy

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

    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@yahoo .comwrote in message
    news:3cef1aeb.0 307201152.3cbf4 de3@posting.goo gle.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.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

    • Ruud de Koter

      #3
      Re: Oracle JDBC, SQLException, COMMIT is not allowed in a subordinatesess ion

      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" <qcircuit@yahoo .comwrote in message
      news:3cef1aeb.0 307201152.3cbf4 de3@posting.goo gle.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.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
      [...]
      --
      --------------------------------------------------------------------------------------
      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 : ruud_dekoter@hp .com

      internet: http://www.openview.hp.com/products/servicedesk
      intranet: http://ovweb.bbn.hp.com/itservicemanager
      --------------------------------------------------------------------------------------

      Comment

      • Ruud de Koter

        #4
        Re: Oracle JDBC, SQLException, COMMIT is not allowed in a subordinatesess ion

        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" <qcircuit@yahoo .comwrote in message
        news:3cef1aeb.0 307201152.3cbf4 de3@posting.goo gle.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.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
        [...]
        --
        --------------------------------------------------------------------------------------
        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 : ruud_dekoter@hp .com

        internet: http://www.openview.hp.com/products/servicedesk
        intranet: http://ovweb.bbn.hp.com/itservicemanager
        --------------------------------------------------------------------------------------

        Comment

        Working...