Re: How can i keep an ado connection alive?



> 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


.



Relevant Pages

  • DBPool: JDBC Connection Pooling - updated
    ... Latest update of DBPool is available at http://www.snaq.net/java/DBPool/ ... applications that require high performance database access. ... User-definable connection validation allows increased reliability ... DBPool has been used in many large-scale commercial applications throughout ...
    (comp.lang.java.databases)
  • Re: [ANN] DBPool : JDBC Connection Pooling - v4.7.2 released
    ... > A new version of DBPool has been released, ... > applications that require high performance database access. ... > * User-configurable pools to achieve high performance ... > * User-definable connection validation allows increased reliability ...
    (comp.lang.java.databases)
  • [ANN] DBPool : JDBC Connection Pooling - v4.7 released
    ... A new version of DBPool has been released, ... applications that require high performance database access. ... User-configurable pools to achieve high performance ... User-definable connection validation allows increased reliability ...
    (comp.lang.java.databases)
  • [ANN] DBPool : JDBC Connection Pooling - v4.7.2 released
    ... A new version of DBPool has been released, ... applications that require high performance database access. ... * User-configurable pools to achieve high performance ... * User-definable connection validation allows increased reliability ...
    (comp.lang.java.databases)