commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adrian Tarau (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DBCP-458) Allow subclasses of BasicDataSource to provide their own GenericObjectPool implementation
Date Thu, 07 Apr 2016 22:20:25 GMT

     [ https://issues.apache.org/jira/browse/DBCP-458?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Adrian Tarau updated DBCP-458:
------------------------------
    Attachment: DBCP-458.patch

Here it goes ... there is no need for a test, it is already covered by existing tests (all
tests passed)

> Allow subclasses of BasicDataSource to provide their own GenericObjectPool implementation
> -----------------------------------------------------------------------------------------
>
>                 Key: DBCP-458
>                 URL: https://issues.apache.org/jira/browse/DBCP-458
>             Project: Commons Dbcp
>          Issue Type: Improvement
>    Affects Versions: 2.1.1
>            Reporter: Adrian Tarau
>         Attachments: DBCP-458.patch
>
>
> I had the same need in an older version and I had to do a terrible hack which I would
not like to do with a newer version.
> The main idea is that I would like to be able to monitor borrow and return events (among
other things) and for that I need to provide my own GenericObjectPool implementation.
> It would be a small change to add a createObjectPool method and use it in createConnectionPool.
Default implementation would be to 
> {code}
> if (abandonedConfig != null &&
>                 (abandonedConfig.getRemoveAbandonedOnBorrow() ||
>                  abandonedConfig.getRemoveAbandonedOnMaintenance())) {
>             gop = new GenericObjectPool<>(factory, config, abandonedConfig);
>         }
>         else {
>             gop = new GenericObjectPool<>(factory, config);
>         }
> {code}
> Subclasses would have the flexibility to provide their own pool implementation.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message