| Author |
Connection object in context listenter
|
A Kumar
Ranch Hand
Joined: Jul 04, 2004
Posts: 973
|
|
Hi, I have a doubt.... Suppose, you write code to create connection in the context listener...for a database that resides at a remote location.. in due course of time..if there is a problem in network where in you are not able to access the database... and sometime later..the network problem is restored... then what happens to the connection ?? Regards
|
 |
Eddy Lee Sin Ti
Ranch Hand
Joined: Oct 06, 2005
Posts: 135
|
|
|
The cached connection will become stale and throw exception when you try to do some database operations. You should explicitly open and close the connection whenever it is possible. By using some connection pooling data source, open connection means obtaining an opened connection from the pool and close is to return the connection back to the pool. The pool can be configured to invalidate the stale connection and recreate them.
|
SCJP, SCWCD, SCJWS, IBM 700,IBM 701, IBM 704, IBM 705, CA Clarity Technical<br /> <br /><a href="http://eddyleesinti.blogspot.com" target="_blank" rel="nofollow">http://eddyleesinti.blogspot.com</a>
|
 |
A Kumar
Ranch Hand
Joined: Jul 04, 2004
Posts: 973
|
|
Hi Eddy, I posted the doubt with reference to the below post... Database Connection Regards
|
 |
Joel Hutters
Greenhorn
Joined: Sep 07, 2006
Posts: 21
|
|
|
You can use autoReconnect=true on your connection url.
|
 |
A Kumar
Ranch Hand
Joined: Jul 04, 2004
Posts: 973
|
|
|
Thanks Joel!!! I would check with that...
|
 |
 |
|
|
subject: Connection object in context listenter
|
|
|