2 Replies Latest reply on Oct 18, 2002 1:08 AM by davidjencks

    MySQL 4.x.x / JBoss 3.0.0

    gabrielm

      18:42:19,781 INFO [STDOUT] org.jboss.util.NestedSQLException: No ManagedConnections Available!; - nested throwable: (javax.resource.ResourceException: No ManagedConnections Available!)

      This is an error I get after I use about 30-40 connections out of the 50 set up in the XML file. I'll paste my config deployer below:

      <?xml version="1.0" encoding="UTF-8"?>




      <depends optional-attribute-name="ManagedConnectionFactoryName">


      MySqlDS



      <config-property name="ConnectionURL" type="java.lang.String">jdbc:mysql://127.0.0.1:3306/tasklist</config-property>
      <config-property name="DriverClass" type="java.lang.String">org.gjt.mm.mysql.Driver</config-property>
      <config-property name="UserName" type="java.lang.String">root</config-property>
      <config-property name="Password" type="java.lang.String">root</config-property>




      <depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=JBoss LocalTransaction JDBC Wrapper




      <depends optional-attribute-name="ManagedConnectionPool">


      0
      10
      5000
      5
      ByNothing



      <depends optional-attribute-name="CachedConnectionManager">jboss.jca:service=CachedConnectionManager
      <depends optional-attribute-name="JaasSecurityManagerService">jboss.security:name=JaasSecurityManager
      java:/TransactionManager
      jboss.jca:service=RARDeployer



        • 1. Re: MySQL 4.x.x / JBoss 3.0.0
          gabrielm

          I upgraded to JBoss 3.0.3-Tomcat 4.0.5 and it's still the same. (the XML descriptor change a little, AFAIK) I'm now upgrading MySQL (both JBoss and MySQL run on the same Win2K box).
          Here's the code I use to connect:

          public static Connection getConnection() throws SQLException {
          try {
          Context ctx = new InitialContext();
          DataSource ds =
          (DataSource)ctx.lookup("java:/MySqlDS");
          ds.getConnection();
          return ds.getConnection();
          } catch(Exception e) {
          System.out.println(e);
          throw new SQLException(
          "The system was unable to establish a connection to the database.");
          }
          };

          Any ideas? I'm really desperate! :-)

          • 2. Re: MySQL 4.x.x / JBoss 3.0.0
            davidjencks

            Look closely at your code. You get 2 connections from the pool on every call to your method. One is never closed, just abandoned.