Is it possible it’s a configuration issue? I’m setting minConnections to 1 and 
maxConnections to 10. Should I rather leave these at default values or choose 
different values?

Cheers,
- hugi

// Hugi Thordarson
// http://www.loftfar.is/
// s. 895-6688



> On 7. mar. 2016, at 20:01, Hugi Thordarson <[email protected]> wrote:
> 
> Thanks for the reply Andrus!
> 
> Sounds like it might be the case. But actually, this now happens without the 
> DB going down (and I don’t think it’s a communication problem with the DB 
> either, since the DB runs on the same server as the apps).
> 
> I recently added a PostCommitListener that does quite a lot of DB work and I 
> believe the issue started around the same time. At first I thought it might 
> be a deadlocking sitation, but a jstack thread dump from a dead process does 
> not point to that.
> 
> Is there any way for me to check the number and status of currently open 
> connections?
> 
> Cheers,
> - hugi
> 
> 
> 
>> On 7. mar. 2016, at 18:54, Andrus Adamchik <[email protected]> wrote:
>> 
>> Hmm... It shows there are zero connections in the pool. I have a theory 
>> about that. Looks like when you uncheck your first connection after the DB 
>> restart, pool goes through all connections to find a valid one, and removing 
>> bad connections in the process. As there are no longer valid connections 
>> there, the pool is drained completely. Then the error happens; and then at a 
>> later time, pool manager thread kicks in and fills the pool with new 
>> connections. 
>> 
>> I need to test it.. And perhaps move the validation to background. 
>> 
>> (and perhaps add Tomcat connection pool to a list of DataSource options ... 
>> that's the one I am using in Bootique: https://github.com/nhl/bootique-jdbc 
>> and elsewhere in production).
>> 
>> Andrus
>> 
>>> On Mar 7, 2016, at 2:46 AM, Hugi Thordarson <[email protected]> wrote:
>>> 
>>> Hi all,
>>> This is still happening, even after I added a validationQuery, our app is 
>>> dying quite frequently :(.  I’m not quite sure how to debug this, is there 
>>> any way for me to catch where connections are being opened in the code and 
>>> at what location they’re hanging?
>>> 
>>> https://www.dropbox.com/s/8jkmh6513s6wwkn/Screenshot%202016-03-07%2010.21.53.png?dl=0
>>> 
>>> Cheer,
>>> - hugi
>>> 
>>> // Hugi Thordarson
>>> // http://www.loftfar.is/
>>> // s. 895-6688
>>> 
>>> 
>>> 
>>>> On 29. feb. 2016, at 11:25, Andrus Adamchik <[email protected]> wrote:
>>>> 
>>>> 
>>>>> On Feb 29, 2016, at 2:20 PM, Hugi Thordarson <[email protected]> wrote:
>>>>> 
>>>>> What does validationQuery do?
>>>> 
>>>> Periodically executes for each pooled connection, and kills connections 
>>>> that throw during validation. So it ensures that all pooled connections 
>>>> are in a good state.
>>>> 
>>>> Andrus
>>>> 
>>> 
>> 
> 

Reply via email to