That would definitely work for handling the timeouts, but I'd prefer to prevent them if possible. (Postgres allows 100 concurrent connections by default and I don't think I've ever used more than 3 of them at a time, so having one just hang out and rarely get used is not an issue.)