struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yee, Richard K,,DMDCWEST" <Ye...@osd.pentagon.mil>
Subject RE: Tool to diagnose J2EE/Struts/Oracle problem
Date Thu, 18 Sep 2003 19:55:21 GMT
Matt,
> However, if your app is like mine probably a dozen or so connections are
opened for each Action that is
> performed, so it's hard to ensure you are closing all connections
correctly. 

Do you really have that many nested result sets? If not, then you could
reuse the same connections for some of your queries.

Reagards,

Richard

-----Original Message-----
From: Sgarlata Matt [mailto:sgarlata_matt@bah.com] 
Sent: Thursday, September 18, 2003 9:26 AM
To: Struts Users Mailing List
Subject: Re: Tool to diagnose J2EE/Struts/Oracle problem


Hi again Stella,

Let me start by saying that I am also using Struts and Oracle, so we have a
similar setup.  We were experiencing the same problems you were experiencing
until we set up connection pooling.  I highly recommend that you develop
your app using the org.apache.commons.dbcp.AbandonedObjectPool because it is
the only way to make sure you are dealing with connections correctly.  To
use connections properly you must close them when you are done and this
class makes sure you do, otherwise it starts throwing exceptions.  For more
information, see

http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-how
to.html#Database%20Connection%20Pool%20(DBCP)%20Configurations

in the section called "Preventing db connection pool leaks".  For production
we are using the pool that comes with Oracle's application server, release
2.  Also, additional comments to your specific questions are below.
----- Original Message ----- 
From: "Au-Yeung, Stella H" <stella.au-yeung@eds.com>
To: "'Struts Users Mailing List'" <struts-user@jakarta.apache.org>
Sent: Thursday, September 18, 2003 12:10 PM
Subject: RE: Tool to diagnose J2EE/Struts/Oracle problem


> Matt:
> You mentioned the following:
> >> Garbage collection does not release database connections.
>
> IN that case, do you know who releases the connections and make it
available
> for re-use after conn.close() has been done.  It sounds like you must 
> have read from somewhere that said GC doesn't release connections.

To the best of my knowledge conn.close() should close the connection so that
it no longer displays as a used connection in Oracle.  However, if your app
is like mine probably a dozen or so connections are opened for each Action
that is performed, so it's hard to ensure you are closing all connections
correctly.  This is where the AbandonedObjectPool I discussed earlier comes
into play.  The GC won't call conn.close() for you, and you probably just
forgot to close connections in a few places.  Even after practicing for
weeks I still forget to close connections weekly and AbandonedObjectPool
comes to the rescue :)

> Stella
>
>
> -----Original Message-----
> From: Sgarlata Matt [mailto:sgarlata_matt@bah.com]
> Sent: Wednesday, September 17, 2003 10:56 PM
> To: Struts Users Mailing List
> Subject: Re: Tool to diagnose J2EE/Struts/Oracle problem
>
>
> You should investigate using connection pooling, such as is offered by 
> the DBCP project, which is a Jakarta Commons subproject.  Garbage 
> collection does not release database connections.  I'm not sure on all 
> the details
why
> not, but there are other reasons to use connection pooling such as 
> performance.
> ----- Original Message -----
> From: "Au-Yeung, Stella H" <stella.au-yeung@eds.com>
> To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
> Sent: Wednesday, September 17, 2003 10:52 PM
> Subject: Tool to diagnose J2EE/Struts/Oracle problem
>
>
> > I am havng a No resource Available problem with my J2EE/Struts/Oracle
> > application.   It is saying I don't have any more Oracle connections
> > available.   Even I am closing the result set, statement and connection,
I
> > am still running into the problem.   When I use the Oracle DBA monitor
> tool,
> > it shows that I have 10 'inactive' connection but then my app will 
> > give
> the
> > 'no resource available' error.   So it looks like somehow it is not
> reusing
> > those inactive connections.   Does Gabage Collection release those
> > connections?  Does anyone have this problem before?
> >
> > So I am looking for a better 'tool' to find out why GC doesn't 
> > release
> those
> > connections or if those 10 'inactive' connections are actually 
> > available
> to
> > be re-used.  Can someone give me a suggestion on this tool or how to 
> > troubleshoot the problem?
> >
> > Thanks
> > Stella
> >
> >
> > --------------------------------------------------------------------
> > -
> > 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


Mime
View raw message