----- Original Message ----- From: "sinoea kaabi" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <users@tomcat.apache.org>
Sent: Wednesday, September 17, 2008 9:56 PM
Subject: RE: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing....



Right, I have attached the source code.

I have included the whole package with the database classes.
Also, I have included the package with three action classes, in reality there are more action classes but it would be a nightmare, and also the database classes are used quiet similarly in other action classes.

This is a Struts web application, so action classes are used.

=> Arrrg not our favorite... should be fun

Notice on some database classes where I use the connection in several inner methods:

public static void doSomething(datasource) {

     Connection connection = datasource.getConnection();
     try {
            innerMethod(connection);
            anotherInnerMethod(connection);

     } finally {
connection.close(); // should be OK to use the connection in inner classes, as the connection gets finally closed.
     }
}


private static void innerMethod(connection) {
        Statetement statement = connection.createStatement();
        try {

        } finally {
             statement.close();
        }
}


If you spot a problem then FANTASTIC.

I have had this problem for years and I really want to solve the problem now.

Also, I would be grateful if you could let me know how you design your database classes.

=> Everything is ours.... we dont use frameworks
=> Pools, Persistence... all our own stuff... makes it kind of easy to find problems ;)

The whole pattern and usage basically.

=> KISS... keep it simple stupid ;)
=> Basic TC MVC patterns... you can read up on them on the web... MVC methodology, not a framework
CoreServlets has some nice articles....

Thanks for putting up with me so far....

=> Hey I'm bored stiff... our banks are still running here... ha ha...

=> Its almost midnight here... we'll play with it in the morning... looks like you on the same time zone

---------------------------------------------------------------------------
HARBOR : http://www.kewlstuff.co.za/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
---------------------------------------------------------------------------


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to