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/07/10 07:24:31 UTC

Testing for con.close()

Hi,

I have implemented the connection pooling provided by Struts for
developing my application.

The application after going live gets hang quite frequently.
The problem may be related to connection not getting closed for some
transactions.

All the transactions takes atleast 1 minute to complete.

I assume that the user might be pressing the "STOP" button of the
browser before the transaction gets completed.
Due to this although we take the connection from the pool but not able
to return back as the last lines of the code are
not reached. I think  that if i had written con.close() in the finally
block then this problem would have not come.

Is there any way by which i can specify in the struts config .xml to
close the connection which are not active or not doing anything.

Regards
Shailender Jain




Re: Testing for con.close()

Posted by Peng Tuck Kwok <pe...@gmail.com>.
Hi, 
Usually I call con.close() in the final block. There is a mention of
this here :
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html#Common%20Problems



On Sat, 10 Jul 2004 10:54:31 +0530, Shailender Jain
<sh...@teleatlas.com> wrote:
> Hi,
> 
> I have implemented the connection pooling provided by Struts for
> developing my application.
> 
> The application after going live gets hang quite frequently.
> The problem may be related to connection not getting closed for some
> transactions.
> 
> All the transactions takes atleast 1 minute to complete.
> 
> I assume that the user might be pressing the "STOP" button of the
> browser before the transaction gets completed.
> Due to this although we take the connection from the pool but not able
> to return back as the last lines of the code are
> not reached. I think  that if i had written con.close() in the finally
> block then this problem would have not come.
> 
> Is there any way by which i can specify in the struts config .xml to
> close the connection which are not active or not doing anything.
> 
> Regards
> Shailender Jain
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org