[ 
http://issues.apache.org/jira/browse/DERBY-1090?page=comments#action_12371422 ] 

Olav Sandstaa commented on DERBY-1090:
--------------------------------------

Hi, David. The main purpose of sending in the patch was to get opinions from 
more people on what would be the best alternative solution to check if a 
connection is valid in the embedded driver. The current alternatives are:

  a) check if connection is not closed followed by a simple query against the 
database (this is implemented by the patch I submitted yesterday)
  b) just check that the connection is not closed (I plan to submit an 
alternative patch for this soon)

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.

> 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
>  Attachments: embedded1090-query.diff
>
> 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

Reply via email to