[
https://issues.apache.org/jira/browse/DBCP-357?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13903580#comment-13903580
]
Mark Thomas commented on DBCP-357:
----------------------------------
The observed behavior with Oracle is not consistent with the description above.
Neither is it consistent with the information provided by the originator of
this bug report. Using the same test as I used for looking at the performance
of PreparedStatements for validation, a validation query of "SELECT 1 FROM
DUAL" executed as a PreparedStatement is 7-8 times slower than using
Connection.isValid(). On this basis the choice of Connection.isValid() as the
default validation looks to be a reasonable one.
The documentation has been updated to make the new default behavior clear and
users remain free to specify their own validation query if they wish.
> 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 was sent by Atlassian JIRA
(v6.1.5#6160)