cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: New connection pool comment
Date Wed, 24 Jun 2015 06:10:29 GMT
I am +1 as well. John, feel free to make this change.

> On Jun 24, 2015, at 1:17 AM, Mike Kienenberger <mkienenb@gmail.com> wrote:
> 
> +1 on that.   John, please make that change.
> 
> I have some ugly code being used right now that would have benefited
> from that change in my PoolManager subclass.
> 
> 
>    public Connection getConnection() throws SQLException {
>        try {
>            return super.getConnection();
>        } catch (SQLException e) {
>            String exceptionMessage = e.getMessage();
>            if (exceptionMessage.startsWith("Can't obtain connection.
> Request timed out.")) {
> [...]
>            }
>            throw e;
>       }
> 
> On Tue, Jun 23, 2015 at 5:14 PM, John Huss <johnthuss@gmail.com> wrote:
>> I'm working on integrating my apps with the latest changes and I noticed
>> that in the new connection pool there isn't a special exception thrown when
>> the pool is exhausted (too busy).  It was handy to be able to identify that
>> situation.
>> 
>> It's in UnmanagedPoolingDataSource line 326:
>> throw new SQLException("Can't obtain connection. Request to pool timed out.
>> Total pool size: " + pool.size());
>> 
>> It used to throw ConnectionUnavailableException
>> 
>> Any chance this can be reintroduced?
>> 
>> John
> 


Mime
View raw message