commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Westbom <swest...@yahoo.com>
Subject RE: Connection is closed
Date Mon, 29 Mar 2004 21:28:54 GMT
Frequently firewalls, routers, servers and databases can be set up to time out
a socket connection based on inactivity.  You can:

1. Check to see if they are live on checkout with DBCP by having it ping the
database before giving you the connection (expensive but almost foolproof)  

2. Kill them after a certain period of inactivity in the pool to deal with
timeouts (better bet for most cases where performance is the primary concern)
and put retry logic in to get a live connection if the connection is dead for
some other reason (AspectJ has a place here)



--- Joao Batistella <joao-p-batistella@ptinovacao.pt> wrote:
> Thanks.
> I do that. I only deal with the connection returned by DBCP. Is there a
> timeout attribute (or anyother thing) that can close the connection?
> 
> -----Original Message-----
> From: Stephen Westbom [mailto:swestbom@yahoo.com]
> Sent: segunda-feira, 29 de março de 2004 12:47
> To: Jakarta Commons Users List
> Subject: Re: Connection is closed
> 
> 
> Just a guess, but after your last question, don't ever call the close()
> method
> on the underlying connection object.  That truly  closes the connection and
> you
> will have a dead one in the pool.  Only call close() on the DBCP connection
> object decorator which simply returns the connection to the pool.
> 
> --- Joao Batistella <joao-p-batistella@ptinovacao.pt> wrote:
> > Hello!
> > 
> > I started using DBCP with Oracle 8i and I'm having the error "Connection
> is
> > closed" sometimes. How can I change the DBCP configuration to avoid this
> > kind of error?
> > 
> > Thanks,
> > JP
> > 
> 
> 
> =====
> Your source for complex solutions to simple problems
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Finance Tax Center - File online. File on time.
> http://taxes.yahoo.com/filing.html
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 


=====
Your source for complex solutions to simple problems

__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

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


Mime
View raw message