cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <>
Subject Re: Reconnecting automatically after DB downtime
Date Wed, 09 Mar 2016 19:40:30 GMT

> On Mar 9, 2016, at 7:34 AM, Andrus Adamchik <> wrote:
>> On Mar 9, 2016, at 12:52 AM, Hugi Thordarson <> wrote:
>> Nice, works like a charm :).
>> On a side note, websites that I’ve switched to HikariCP have been up since the
switch, so it does seem to have been a problem with Cayenne’s connection pool.
> Yeah, I'll jira that. Will need to investigate.

The problem wasn't what I originally thought it was. Instead what happened is this: at the
moments when the DB was down, UnmanagedPoolingDataSource.createUnchecked(..) would decrement
a semaphore controlling max pool size without creating a connection. So any DB hiccup would
result in permanent pool shrinkage. 

Just fixed it per .

(Lack of) fair scheduling limitation mentioned by John still exists. So when there is a contention,
failure rate may be higher then it would be with fair scheduling (I observed this in my unit
tests, even though I wasn't specifically testing this condition). Shouldn't be an issue if
the pool has enough connections. 

Still a third party pool is probably a better choice for production. Like I said, our pool
is intentionally basic.

View raw message