You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jarnot Voytek Contr AU HQ/SC <Vo...@MAXWELL.AF.MIL> on 2003/02/19 20:12:54 UTC
[OT] RE: DBCP could not obtain an idle db connection pool exhaust
ed
I don't know how much advantage it is ... I have just never seen the point
of doing the jndi lookup more than once.
--
Voytek Jarnot
Quidquid latine dictum sit, altum viditur.
> -----Original Message-----
> From: Brandon Goodin [mailto:mail@phase.ws]
> Sent: Wednesday, February 19, 2003 1:09 PM
> To: Struts Users Mailing List
> Subject: RE: DBCP could not obtain an idle db connection pool
> exhausted
>
>
> 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
> mail@phase.ws
> http://www.phase.ws
>
>
> -----Original Message-----
> From: Jarnot Voytek Contr AU HQ/SC
> [mailto:Voytek.Jarnot@MAXWELL.AF.MIL]
> 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:mail@phase.ws]
> > 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
> > mail@phase.ws
> > http://www.phase.ws
> >
> >
> > -----Original Message-----
> > From: Scott Power [mailto:spower@jacqueswhitford.com]
> > Sent: Wednesday, February 19, 2003 11:11 AM
> > To: struts-user@jakarta.apache.org
> > 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: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org