You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Shailender Jain <sh...@teleatlas.com> on 2004/06/09 07:44:40 UTC
Connection Pooling
I have fished developing the application using Struts and Tomcat 5.0.16
as server.
We used the Connection Pooling provided by Struts (DBCP)
After the development we have realized that somewhere in the application
the connection is not
getting closed. Due to this the application is getting hang very
frequently. We have actually assumed that the application gets hang due
to
this reason only.
Is there any way to DEBUG where in the application where the connection
is not getting closed.
Regards
Shailender Jain
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Connection Pooling
Posted by Masashi Nakane <na...@mie-com.co.jp>.
Check
http://jakarta.apache.org/commons/dbcp/configuration.html
's abandanded something parameters.
I am not sure about how to apply this to Struts Datasource.
I've just replaced Struts Datasouce with tomcat JNDI datasource with DBCP.
to decouple Struts and DAOs.
Masashi
At 12:55 04/06/09 +0530, you wrote:
>Thanks for your attention.
>
>"Abandand connection management" can you give more details on how to do this.
>
>
>
>Masashi Nakane wrote:
>
> > And if you have a chance to try DBCP , Abandand connection management
> > function will tell you exactly where the unclosed connections are . You
> > will love this.
> >
> > Masashi
> >
> > At 23:33 04/06/08 -0700, you wrote:
> > >"And Some other guy says the set the max number of connectons to 1."
> > >
> > >Yes this is another good way, thank you for bringing that up. I had a
> > >fairly big app that was throwing away connections and when I set the
> > >max connections to 1 it became almost immediately aparent where the
> > >problem was.
> > >
> > >Good suggestion Masashi.
> > >
> > >---------------------------------------------------------------------
> > >To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > >For additional commands, e-mail: user-help@struts.apache.org
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Connection Pooling
Posted by Shailender Jain <sh...@teleatlas.com>.
Thanks for your attention.
"Abandand connection management" can you give more details on how to do this.
Masashi Nakane wrote:
> And if you have a chance to try DBCP , Abandand connection management
> function will tell you exactly where the unclosed connections are . You
> will love this.
>
> Masashi
>
> At 23:33 04/06/08 -0700, you wrote:
> >"And Some other guy says the set the max number of connectons to 1."
> >
> >Yes this is another good way, thank you for bringing that up. I had a
> >fairly big app that was throwing away connections and when I set the
> >max connections to 1 it became almost immediately aparent where the
> >problem was.
> >
> >Good suggestion Masashi.
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >For additional commands, e-mail: user-help@struts.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Connection Pooling
Posted by Masashi Nakane <na...@mie-com.co.jp>.
And if you have a chance to try DBCP , Abandand connection management
function will tell you exactly where the unclosed connections are . You
will love this.
Masashi
At 23:33 04/06/08 -0700, you wrote:
>"And Some other guy says the set the max number of connectons to 1."
>
>Yes this is another good way, thank you for bringing that up. I had a
>fairly big app that was throwing away connections and when I set the
>max connections to 1 it became almost immediately aparent where the
>problem was.
>
>Good suggestion Masashi.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Connection Pooling
Posted by Riyad Kalla <rk...@gmail.com>.
"And Some other guy says the set the max number of connectons to 1."
Yes this is another good way, thank you for bringing that up. I had a
fairly big app that was throwing away connections and when I set the
max connections to 1 it became almost immediately aparent where the
problem was.
Good suggestion Masashi.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Connection Pooling
Posted by Masashi Nakane <na...@mie-com.co.jp>.
I'm using Oracle and when I meet that situation,
i check the DB session (v$session) and operate GUI .
When number of DB sessions increase, that is the timing .
And Some other guy says the set the max number of connectons to 1.
hope this help
At 22:49 04/06/08 -0700, you wrote:
>This may seem to simplistic, but you could do a search for whichever
>method you call to open a connection and then do a search for
>connection.close() (or whatever you named the variable) and see if the
>numbers add up... if they don't, this might help you narrow down which
>file the two aren't syncronous with eachother.
>
>Like I said though, this is the brute-force approach, I don't know a
>'good' way to do this off hand.
>
>On Wed, 09 Jun 2004 11:14:40 +0530, Shailender Jain
><sh...@teleatlas.com> wrote:
> >
> > I have fished developing the application using Struts and Tomcat 5.0.16
> > as server.
> >
> > We used the Connection Pooling provided by Struts (DBCP)
> >
> > After the development we have realized that somewhere in the application
> > the connection is not
> > getting closed. Due to this the application is getting hang very
> > frequently. We have actually assumed that the application gets hang due
> > to
> > this reason only.
> >
> > Is there any way to DEBUG where in the application where the connection
> > is not getting closed.
> >
> > Regards
> > Shailender Jain
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Connection Pooling
Posted by Shailender Jain <sh...@teleatlas.com>.
Thanks for the response.
I am using the "getConnection(request)" method to get the connection
and then "connection.close()" to close the connection.
"getConnection()" and "close()" both are in library files provided by struts
(DBCP).
Therefore it is difficult to put the counter in these methods.
Any idea how can we put the counters in these methods?
Or there is any way in which if i increase the DEBUG level and investigate the
log file generated by Tomcat (catalina.out)
Riyad Kalla wrote:
> This may seem to simplistic, but you could do a search for whichever
> method you call to open a connection and then do a search for
> connection.close() (or whatever you named the variable) and see if the
> numbers add up... if they don't, this might help you narrow down which
> file the two aren't syncronous with eachother.
>
> Like I said though, this is the brute-force approach, I don't know a
> 'good' way to do this off hand.
>
> On Wed, 09 Jun 2004 11:14:40 +0530, Shailender Jain
> <sh...@teleatlas.com> wrote:
> >
> > I have fished developing the application using Struts and Tomcat 5.0.16
> > as server.
> >
> > We used the Connection Pooling provided by Struts (DBCP)
> >
> > After the development we have realized that somewhere in the application
> > the connection is not
> > getting closed. Due to this the application is getting hang very
> > frequently. We have actually assumed that the application gets hang due
> > to
> > this reason only.
> >
> > Is there any way to DEBUG where in the application where the connection
> > is not getting closed.
> >
> > Regards
> > Shailender Jain
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Connection Pooling
Posted by Riyad Kalla <rk...@gmail.com>.
This may seem to simplistic, but you could do a search for whichever
method you call to open a connection and then do a search for
connection.close() (or whatever you named the variable) and see if the
numbers add up... if they don't, this might help you narrow down which
file the two aren't syncronous with eachother.
Like I said though, this is the brute-force approach, I don't know a
'good' way to do this off hand.
On Wed, 09 Jun 2004 11:14:40 +0530, Shailender Jain
<sh...@teleatlas.com> wrote:
>
> I have fished developing the application using Struts and Tomcat 5.0.16
> as server.
>
> We used the Connection Pooling provided by Struts (DBCP)
>
> After the development we have realized that somewhere in the application
> the connection is not
> getting closed. Due to this the application is getting hang very
> frequently. We have actually assumed that the application gets hang due
> to
> this reason only.
>
> Is there any way to DEBUG where in the application where the connection
> is not getting closed.
>
> Regards
> Shailender Jain
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org