How much advantage is caching the datasource lookup? Isn't that the whole idea of a ConnectionPool and the jndi lookup. Isn't the registry just pointing to a persistent object resource? I am curious what kind of performance boost one gets when caching a DataSource Lookup.
Brandon Goodin Phase Web and Multimedia PO Box 85 Whitefish MT 59937 P (406) 862-2245 F (406) 862-0354 [EMAIL PROTECTED] http://www.phase.ws -----Original Message----- From: Jarnot Voytek Contr AU HQ/SC [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 19, 2003 11:57 AM To: 'Struts Users Mailing List' Subject: RE: DBCP could not obtain an idle db connection pool exhausted It would also be a good idea to only do the DataSource lookup one time, and cache it... -- Voytek Jarnot Quidquid latine dictum sit, altum viditur. > -----Original Message----- > From: Brandon Goodin [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, February 19, 2003 12:54 PM > To: Struts Users Mailing List > Subject: RE: DBCP could not obtain an idle db connection pool > exhausted > > > try making your getDbConnection method static. It might be holding a > reference to your utilclass that you have instantiated. It > might be taking > longer to gc the class. This is just a guess. > > Example: > > public static Connection getDbConnection() { > > ... > > } > > Brandon Goodin > Phase Web and Multimedia > PO Box 85 > Whitefish MT 59937 > P (406) 862-2245 > F (406) 862-0354 > [EMAIL PROTECTED] > http://www.phase.ws > > > -----Original Message----- > From: Scott Power [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, February 19, 2003 11:11 AM > To: [EMAIL PROTECTED] > Subject: DBCP could not obtain an idle db connection pool exhausted > > > Hi folks, > > Here's my situation, I am using tomcat(latest version) and > mysql,jdbc(mysql ..connector..jar) and struts for an application with > connection pooling. I can not figure out why my connection > stay around > once I close them, they are not sent back to the pool. > > I create a connection then I > > Connection myConnection = utilclass.getDbConnection(); > > the getDBconnetion() method is here: > > public Connection getDbConnection() { > String contextString = "java:comp/env/jdbc/cms"; > Connection localConnection = null; > DataSource myBasicDataSource = null; > > try { > Context myContext = new InitialContext(); > myBasicDataSource = (DataSource) > myContext.lookup(contextString); > localConnection = > myBasicDataSource.getConnection(); > } > ..................return localConnection; > > > I use the connection for a statement and a result set. > > I close the connection > myConnection .close(); > > I have also found out that you should be closing the result > set and the > statement also, which I have tried but that did not resolve > my problem. > When I check out the DB I see the connections that are created during > the application but they remain there in sleep until tomcat is > shutdown. > > I have added the following to my server.xml to clean up connections > > <name>removeAbandoned</name> > <value>true</value> > </parameter> > <parameter> > <name>removeAbandonedTimeout</name> > <value>10</value> > </parameter> > <parameter> > <name>logAbandoned</name> > <value>true</value> > </parameter> > > but this does not seem to work, I added it in the jdbc resource params > section. Is there a way to clean up these connections that are lying > around. I connect many times to the db and I thought that in > the end of > things I should only have one connection left, all the other > connections > were closed but not reclaimed. > > I could really use some help on this one. > > Thanks > > Scott > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]