You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Philippe Mouawad (JIRA)" <ji...@apache.org> on 2011/04/28 14:09:03 UTC

[jira] [Created] (DBCP-357) Connection validationQuery mechanism should be replaced by new method connection#isValid()

Connection validationQuery mechanism should be replaced by new method connection#isValid()
------------------------------------------------------------------------------------------

                 Key: DBCP-357
                 URL: https://issues.apache.org/jira/browse/DBCP-357
             Project: Commons Dbcp
          Issue Type: Improvement
    Affects Versions: 1.4, 1.4.1
            Reporter: Philippe Mouawad


Hello,
Current method of connection validation relies on validationQuery.
This method has a rather big performance impact on the DB (CPU, for example 3% with SELECT 1 FROM DUAL even with Oracle 10G FAST DUAL) and make an additional query for each borrow (when testOnBorrow is true).
Wouldn't it be better to use new JDBC 4 method isValid which relies on Driver check ? (Oracle would for example use its internal method ping)

Thank you
Philippe
http://www.ubik-ingenierie.com

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (DBCP-357) Connection validationQuery mechanism should be replaced by new method connection#isValid()

Posted by "Tim Walters (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DBCP-357?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13421435#comment-13421435 ] 

Tim Walters commented on DBCP-357:
----------------------------------

Driver check is not always implemented.

Validation query should use a prepared statement instead of normal statement.
This will reduce the CPU usage required for a validation check significantly as database wont need to re-parse query each time.
                
> Connection validationQuery mechanism should be replaced by new method connection#isValid()
> ------------------------------------------------------------------------------------------
>
>                 Key: DBCP-357
>                 URL: https://issues.apache.org/jira/browse/DBCP-357
>             Project: Commons Dbcp
>          Issue Type: Improvement
>    Affects Versions: 1.4, 1.4.1
>            Reporter: Philippe Mouawad
>              Labels: PERFORMANCE
>             Fix For: 2.0
>
>
> Hello,
> Current method of connection validation relies on validationQuery.
> This method has a rather big performance impact on the DB (CPU, for example 3% with SELECT 1 FROM DUAL even with Oracle 10G FAST DUAL) and make an additional query for each borrow (when testOnBorrow is true).
> Wouldn't it be better to use new JDBC 4 method isValid which relies on Driver check ? (Oracle would for example use its internal method ping)
> Thank you
> Philippe
> http://www.ubik-ingenierie.com

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DBCP-357) Connection validationQuery mechanism should be replaced by new method connection#isValid()

Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DBCP-357?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phil Steitz updated DBCP-357:
-----------------------------

    Fix Version/s: 2.0

> Connection validationQuery mechanism should be replaced by new method connection#isValid()
> ------------------------------------------------------------------------------------------
>
>                 Key: DBCP-357
>                 URL: https://issues.apache.org/jira/browse/DBCP-357
>             Project: Commons Dbcp
>          Issue Type: Improvement
>    Affects Versions: 1.4, 1.4.1
>            Reporter: Philippe Mouawad
>              Labels: PERFORMANCE
>             Fix For: 2.0
>
>
> Hello,
> Current method of connection validation relies on validationQuery.
> This method has a rather big performance impact on the DB (CPU, for example 3% with SELECT 1 FROM DUAL even with Oracle 10G FAST DUAL) and make an additional query for each borrow (when testOnBorrow is true).
> Wouldn't it be better to use new JDBC 4 method isValid which relies on Driver check ? (Oracle would for example use its internal method ping)
> Thank you
> Philippe
> http://www.ubik-ingenierie.com

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (DBCP-357) Connection validationQuery mechanism should be replaced by new method connection#isValid()

Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DBCP-357?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13027351#comment-13027351 ] 

Phil Steitz commented on DBCP-357:
----------------------------------

Looks like a good enhancement for 2.0.  We should probably make it configurable, though, whether to rely on the driver implementation or actually fire the validation query.

> Connection validationQuery mechanism should be replaced by new method connection#isValid()
> ------------------------------------------------------------------------------------------
>
>                 Key: DBCP-357
>                 URL: https://issues.apache.org/jira/browse/DBCP-357
>             Project: Commons Dbcp
>          Issue Type: Improvement
>    Affects Versions: 1.4, 1.4.1
>            Reporter: Philippe Mouawad
>              Labels: PERFORMANCE
>             Fix For: 2.0
>
>
> Hello,
> Current method of connection validation relies on validationQuery.
> This method has a rather big performance impact on the DB (CPU, for example 3% with SELECT 1 FROM DUAL even with Oracle 10G FAST DUAL) and make an additional query for each borrow (when testOnBorrow is true).
> Wouldn't it be better to use new JDBC 4 method isValid which relies on Driver check ? (Oracle would for example use its internal method ping)
> Thank you
> Philippe
> http://www.ubik-ingenierie.com

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira