Communications link failure due to underlying exception:

I hate to just post a random error here and expect a solution, but this problem is something that I just can’t figure out. When I launch my application for the first time each day, I usually get about 5 SQL errors, resulting from various queries which are properly formatted. The error description is:

Communications link failure due to underlying exception: 

The odd thing is when I relaunch the application the second time everything works fine. Since this happens every morning, I am guessing that it either has to do with the first launch of the day, or some communications link is timing out since the application was not launched in some time. Personally, neither of these make sense, but they seem like the only explanations.

I searched and unfortunately nobody has posted about this problem. I know the error description is general, but any help would be greatly appreciated.


It sounds like your pooled database connections are becoming invalid overnight, and then when you come in in the morning, you try to use them and they fail. Edit your datasource and check “test on borrow”, and then let us know tomorrow morning if it worked or not.

Thanks Carl for the quick response. I checked ‘Test on borrow’. Are ‘Test on Return’ or ‘Test while idle’ possibly fixes to this problem as well? I have no problem enabling them all to be safe, but I just don’t want to add any unnecessary overhead.

I think they should be unnecessary. Some users have had success in various situations also turning on “Test while idle” (and making the idle evictor run interval non-negative), but I’d start with a simple “Test on Borrow”