3 Replies Latest reply on Apr 15, 2003 4:59 PM by jgiraldo

    SET CHAINED NOT ALLOWED - Sybase

    jgiraldo

      Hi,

      I?m trying to use a Sybase database with the JConnect55 driver.

      My session beans are running under container managed transactions and I?m getting the following error even during SELECT statements:

      com.sybase.jdbc2.jdbc.SybSQLException: SET CHAINED command not allowed within multi-statement transaction

      I know that this is caused by JBoss trying to call SET CHAINED on connections that have autocommit=true (default for JConnect). This is not allowed by Sybase if already within a transaction.

      Does anyone know how to prevent this error ?
      Thanks !

        • 1. Re: SET CHAINED NOT ALLOWED - Sybase
          anfo

          If you search the forums for the error you will find a patched jboss-local-jdbc.rar by djencks (for ver 3.0.4 or .6 i believe) that will fix it. I would alse suggest verifying the connection URL in your sybase-service file has the JCONNECT_VERSION parm set to 5 vs. 6, this resolved many problems with ejb/cmp for me. I know sybase also has a support case open for the set chained issue, dont know the status though as it was just a casual conv. with a support rep. There are many problems with sybase and jboss, if you search the forums you will find many solutions for problems you may not have encountered yet.

          • 2. Re: SET CHAINED NOT ALLOWED - Sybase
            mboulatian

            In your ejb-jar.xml for all those methods which use jdbc you can make them transactional with transaction-type = 'Required'. This should do it if making transactional will not cause any problems for you.

            • 3. Re: SET CHAINED NOT ALLOWED - Sybase
              jgiraldo

              This worked, thanks.
              We were already setting the JCONNECT_VERSION parm set to 5 and this did not solve the problem.
              The error is fixed in JBoss 3.2 RC4, but other problems appear, relating to closing connections from the pool.
              Unfortunately we couldn?t find the jboss-local-jdbc.rar patch by djencks. If anyone knows where to get it, please let me know. We will need to refine our transaction definitions later on anyway - not all methods need the "required" setting.