db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel John Debrunner (JIRA)" <derby-...@db.apache.org>
Subject [jira] Commented: (DERBY-1090) Implement Connection.isValid as defined by JDBC4
Date Tue, 21 Mar 2006 15:14:31 GMT
    [ http://issues.apache.org/jira/browse/DERBY-1090?page=comments#action_12371245 ] 

Daniel John Debrunner commented on DERBY-1090:
----------------------------------------------


The query case actually seems somewhat harder to me, and one needs to understand the code
far more, than the isClosed approach.
Maybe this knowledge needs to exist for the client implementation anyway. I think one has
to see how many ways the query can fail and
then see how many map to the connection being not valid. I don't believe the query failing,
always means the connection is not valid.
If the query failed due to out of memory error, then the connection is still valid.

There's no requirement for the embedded and client dirver to have identical implementations,
the embedded gains performance
by having direct access to the engine, something that is clearly not possible with the client.
This naturally leads to different implementations
for various methods.

> Implement Connection.isValid as defined by JDBC4
> ------------------------------------------------
>
>          Key: DERBY-1090
>          URL: http://issues.apache.org/jira/browse/DERBY-1090
>      Project: Derby
>         Type: Sub-task
>   Components: JDBC
>     Reporter: Olav Sandstaa
>     Assignee: Olav Sandstaa
>     Priority: Minor
>      Fix For: 10.2.0.0

>
> The Javadoc for JDBC4 says this about Connection.isValid:
> boolean isValid(int timeout) throws SQLException
> Returns true if the connection has not been closed and is still valid. The driver shall
submit a query on the connection or use some other mechanism that positively verifies the
connection is still valid when this method is called. 
> The query submitted by the driver to validate the connection shall be executed in the
context of the current transaction. 
> Parameters: timeout - - The time in seconds to wait for the database operation used to
validate the connection to complete. If the timeout period expires before the operation completes,
this method returns false. A value of 0 indicates a timeout is not applied to the database
operation. 
> Returns: true if the connection is valid, false otherwise 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message