I've had a similar "problem". The connection times out and get closed
after a few hours. The solution was to do a query to keep the database
alive, for example "SELECT 1" and that's all. That is done every few
minutes.
The real test is to open 250 connections, and issue queries on each
without idle time. Does connection drop occur on active connections?