3 Replies Latest reply on May 25, 2002 2:08 PM by James Cook

    LocalTxConnection and Sybase support w jBoss 3 RC2

    Cl Michel Newbie

      Hi,

      Since jBoss 3.0.0RC2 and the new JDBC wrappers, an exception is raised when using Sybase jConnect 5.2 JDBC connections:
      "SET CHAINED command not allowed within multi-statement transaction".
      I tried all container-supported transaction modes, without any success. The only workaround I found was to explicitly call con.setAutoCommit(false) before executing my first SQL statement.

      As my code worked on jBoss 2.4.4 as well as on jBoss 3.0.0 RC1, and as the code for the RC2 JDBC wrapper is fairly recent, maybe is there a problem in the implementation of setAutoCommit() method ? Any idea would be wellcomed,

      Regards,

      Cl Michel

        • 1. Re: LocalTxConnection and Sybase support w jBoss 3 RC2
          David Jencks Master

          Do you have any explanation of the meaning of SET CHAINED or the sybase error message?

          Is there any way to log with Sybase or the jdbc driver if and when setAutoCommit is being called on the underlying connection? My impression was that setAutoCommit(false) was always called on the underlying connection at the start of any managed transaction. (From your description of using transaction modes I assume you are using CMT).

          More info would be helpful in tracking this down.

          thanks

          • 2. Re: LocalTxConnection and Sybase support w jBoss 3 RC2
            Todd Hough Newbie

            David,

            I'm running the same setup as clmichel (JBoss 3RC2, jConnect 5.2, CMT) and see the same error. It was working under RC1.

            In Sybase, SET CHAINED = setAutoCommit(false) while SET UNCHAINED = setAutoCommit(true).

            The methods I'm calling are setup as NotSupported and Required. I have one NotSupported method that seems to work but then other NotSupported and Required methods fail (they're not called in that order though).

            I'm not sure about logging from the driver or database.

            Sorry its not much to work from. BTW, JBoss 3 is looking really nice.

            Todd

            • 3. Re: LocalTxConnection and Sybase support w jBoss 3 RC2
              James Cook Newbie

              The problem occurs in LocalManagedConenction.cleanup(). Sybase throws the exception because setAutoCommit(true) is called before the connection closes. You can only perform this operation when the connection is first created. Maybe waiting until after the conn.close() would work.