11 Replies Latest reply on Jan 21, 2004 3:12 AM by wil

    no ManagedConnections available

    wil

       

      "wil@jboss" wrote:
      Hi, i'm currently using jboss 3.0.4 with a mysql4. At a certain time a get a "no ManagedConnections available" exception. I use the standard settings inde mysql-service.xml.
      Can someone tell me where i can see connection-pool information at runtime (or some monitor/dashboard - tool) ? And i do close all of my connections (in a finally block).
      Help !
      wil.


        • 1. Re: no ManagedConnections available
          wil

           

          "wil@jboss" wrote:
          anyone ?


          • 2. Re: no ManagedConnections available
            jfair

             

            "jfair" wrote:
            Using JBoss 3.0.4 also...
            The only place I've modified or viewed connection-pool information is in the mysql-service.xml with the minsize and maxsize attributes. If you use the defaults (a maxsize of 50) in the docs/examples/jca folder, you shouldn't be running out of connections - especially if you're closing connections in the finally block. I've gotten the noManagedConnections available before also - but I had set the managed connections to a really low value of 5....


            • 3. Re: no ManagedConnections available
              jfair

               

              "jfair" wrote:
              I meant set my Maxsize to 5...


              • 4. Re: no ManagedConnections available
                wil

                 

                "wil@jboss" wrote:
                hi there,

                The first time the exception occured was with the standard setting (max 50 etc., indeed the service.xml from the jca examples). Did it also with a "max of 5" but exception still occured.
                Next i took the 15 minutes idle time down to 1 minute. But, although this seems to help, i think that connections aren't pooled effeciently in that manner.
                Do you know of any dashboard, report or admin function/tool for (or standard in) jboss where i can see the actual 'live' connections (currently in pool, currently used, etc). This could help me in locating the cause ... Maybe i missed something in my code ...
                thanks.
                wil.


                • 5. Re: no ManagedConnections available
                  wil

                   

                  "wil@jboss" wrote:
                  hi jfair,

                  The first time the exception occured was with the standard setting (max 50 etc., indeed the service.xml from the jca examples). Did it also with a "max of 5" but exception still occured.
                  Next i took the 15 minutes idle time down to 1 minute. But, although this seems to help, i think that connections aren't pooled effeciently in that manner.
                  Do you know of any dashboard, report or admin function/tool for (or standard in) jboss where i can see the actual 'live' connections (currently in pool, currently used, etc). This could help me in locating the cause ... Maybe i missed something in my code ...
                  thanks.
                  wil.


                  • 6. Re: no ManagedConnections available
                    jfair

                     

                    "jfair" wrote:
                    I seem to remember reading somewhere in the forums that you could set the log level in the log4j.xml to get more detailed information on the number of live connections etc... but I haven't tried this myself.



                    • 7. Re: no ManagedConnections available
                      jfair

                       

                      "jfair" wrote:
                      You may also want to see if there is a sqlplus command that you can use to query the number of connections currently made to a database. I know when I was going against an Oracle database I would query the database to check for the number of open cursors to make sure I was closing all my prepared statements...


                      • 8. Re: no ManagedConnections available
                        ryandeacon

                         

                        "ryandeacon" wrote:
                        If you're using MySQL, just type in at the console: show status;

                        That will show you the number of connection created. Let me know if you find a solution to your problem as I am experiencing a similar issue....


                        • 9. Re: no ManagedConnections available
                          wil

                           

                          "wil@jboss" wrote:
                          Thanks. I'm using mySQLFront and indeed i see the current 'connections' where is do the 'show status'-query.
                          I'm running a test right now (running for 8 hours now) with some modified settings in my mysql-service.xml : i've set the pool to max '200' and the Criteria to 'ByNothing'. Say that is still works tomorrow, than i'm happy that i have a temporary solution. I'll let you know.
                          But afterwards i'm going to look for the cause of the 'No ManagedCon ..." exceptions.
                          later.
                          wil.


                          • 10. Re: no ManagedConnections available
                            ryandeacon

                             

                            "ryandeacon" wrote:
                            Hmm...I haven't used mySQLFront so I have no idea where it would be. Can you get to a console on the system? You need to be able to send a command like show status or show tables, etc.

                            I posted another reply about the No ManagedConnections exception : http://www.jboss.org/modules/bb/index.html?module=bb&op=viewtopic&t= this thread will help as I no longer have problems. Good luck!


                            • 11. Re: no ManagedConnections available
                              wil

                               

                              "wil@jboss" wrote:
                              Hi all,

                              i guess it's solved (for a while now, but didn't find the time to post it).
                              The situation:
                              i'm using connection pools and connections in that case aren't really 'closed' when you do a con.close() (i guess that depends on the implementation of the connection pools).
                              When you 're not using a connection pool, but a simple jdbc connection and, you close the connection, things likes result-sets are cleaned up for you automatically.
                              In a situation where you can have an exception, i put the close-connection in the finally-block. So, in a connection pool setup, the connections are returned to the pool. But with sql-statements that return a resultset AND you have an exception somewhere, the finally does the con.close() stuff. If i put the resultsetInstance.close() in the finally-block, THEN the 'no managed con...' problem is solved. I seem that, if there is still a no-close resultset on a connection which gets closed en returned to the pool, it seems that it is still ' in use '.

                              I guess that this is the cause ?!
                              wil.