db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@apache.org>
Subject Re: [jira] Commented: (DERBY-1090) Implement Connection.isValid as defined by JDBC4
Date Wed, 22 Mar 2006 15:14:35 GMT
Oystein Grovlen - Sun Norway wrote:

> Olav Sandstaa (JIRA) wrote:
> 
>> Dan has suggested that checking for isClosed could be sufficient in
>> the embedded version. It would be good to hear if other have opinions
>> about this. If I do not get other suggestions I will probably propose
>> that the next patch (checking only for isClosed) being reviewed and
>> commited.
> 
> 
> Since the API spec, explicitly mentions running a query to validate the
> connection, I think it would be best to do that. 

No, the API javadoc says:

"The driver shall submit a query on the connection or use some other
mechanism that positively verifies the connection is still valid"

Note the "or use some other mechanism".

> Also, it does not seem
>  very meaningful to add a new method that does exactly the same as an
> existing method.

The definition of Connection.isClosed() is different to isValid(),
that's why isValid was added in JDBC 4.0. For a client side JDBC driver
the implementation will typically be different for isClosed() and
isValid(), only in the embedded driver can they be implemented the same way.

Dan.




Mime
View raw message