1 Reply Latest reply on Feb 7, 2003 5:54 PM by smithk2

    BMP and MySQL

    mecva

      Hi All,

      We are building somes BMP EJB's. We've been trying to access a MySQL database by JNDI using JBoss 3.0.4 with Connector J3.0.5 Gamma as JDBC driver. When I try to get connection an exception is throwed.


      Follows the source code:

      Context c = new InitialContext ();
      javax.sql.DataSource datasource = (javax.sql.DataSource) c.lookup ("java:/AcmeSQL");
      m_connectionDB = datasource.getConnection (new String ("root"), new String (""));


      Follows the exception:

      javax.ejb.EJBException: ICCProductionEJB: Could not create connection; - nested throwable: (java.sql.SQLException: Could not retrieve transaction isolation level from server); - nested throwable: (org.jboss.resource.ResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Could not retrieve transaction isolation level from server))

      What do I need to configure to get the connection properly?

      Thanks in advance,

      MECVA.

        • 1. Re: BMP and MySQL
          smithk2

          This is a bug in the 3.0.5 mysql jdbc driver. Following is a solution to this problem...

          ====

          This is fixed in what will become 3.0.6. You can test the nightly snapshot
          from http://mmmysql.sourceforge.net/snapshots/


          -Mark
          ----- Original Message -----
          To: mark@mysql.com
          Sent: Thursday, February 06, 2003 12:56 AM
          Subject: bug in mysql-connector-java-3.0.5-gamma?



          Mark,


          I am using mysql-connector-java-3.0.5-gamma with mysql 3.23.55 and jboss
          3.0.6.


          When connecting to mysql using a jboss pooled connection I get an error
          (something to the effect of):


          "cannot retrieve transaction isolation level from the server"


          there is a line in Connection.java that goes like this:


          "SHOW VARIABLES LIKE transaction-isolation'"


          which seems to be causing the problem, since, at least with my version of
          mysql, the variable is defined like this:


          "transaction_isolation"


          Since this error prohibits the connection pool from working I changed the
          line to:


          "SHOW VARIABLES LIKE 'transaction_isolation'"


          and recompiled, and it works fine.


          NOTE: This problem does not show up if I call the driver directly using:


          Class.forName(com.mysql.jdbc.Driver);