Re: How can i keep an ado connection alive?
- From: "Stephen Howe" <stephenPOINThoweATtns-globalPOINTcom>
- Date: Thu, 1 Dec 2005 17:13:13 -0000
> I am using a stupid solution that begin a thread to keep geting ado state,
> if the state is adStateClosed, I connect again. Does this solution low
> performance?
It is high performance but not reliable. It is possible for the State to
indicate it is open yet in fact it is closed. SELECT 1 is one the least
demanding round-trip that verifies that the Connection is still valid. After
this I would expect Connection State to correctly reflect the Open/Closed
state.
It is just that you might get an exception because the Connection object
thinks that the connection is still valid.
Note: If you have Connections open but nothing happens for long periods of
time in your Application, consider using Connection pooling as suggested by
David.
Stephen Howe
.
- Prev by Date: AUTONOMOUS TRANSACTION in SQL server 2000
- Next by Date: Re: ADO Recordset open problem IDispatch error #3121
- Previous by thread: AUTONOMOUS TRANSACTION in SQL server 2000
- Next by thread: how to connect to remote computer?
- Index(es):
Relevant Pages
|
|