1 Reply Latest reply on Oct 2, 2004 8:59 PM by shacka

    problem of getting more than 1 connection from DB


      WinXP Pro / Jboss 3.2.5 / MySQL 4.0 / JDK1.4

      Hi, all..

      As I was preparing for the upcoming release of my application, I just
      have noticed that there is only one "ACTIVE" connection to DB and
      every client connection is sharing this single connection..

      I can see 5 connections got created when application is deployed but only
      one of the connection is in use when I ran load-test from 4 different

      Here are the snippets of the relavant (I think) files..





      from codes
      Context jndiContext = new InitialContext();
      DataSource ds = (DataSource) jndiContext.lookup("java:/DefaultDS");

      Is there any other configuration that I am supposed to twick to get multiple connection to MySQL or use ConnectionFactory,
      ConnectionManager, etc..?

      The application runs fine and everything, of course..

      In my setting, I have used "DefaultDS" for minimal changes from
      out-of-box jboss configuration..

      Please shine some insight on this problem..


      PS: oh btw, JBoss rocks..!!!

        • 1. Re: problem of getting more than 1 connection from DB

          Actually, my initial description is wrong..

          I have seen more than one connections utilized when CMP generated
          queries are executed (such as finder method calls)..

          However, the direct jdbc calls within my session beans do use one
          particular connection even if the same call was made by many other

          I am lost and I don't know if it is datasource config or jndi config or
          lookup & my code problem..

          Any suggestion would be greatly appriciated