I think something like this was asked recently, but I didn't see an answer:
If I prepare a statement, is there some time after which I can't use
it? Or does the connection itself time out?
I've been seeing exceptions with connections that sit idle for long
periods of time, and I'm not sure if it's the connection or the
prepared statement that's the problem.
--
House: "Because it doesn't hurt here. Because I don't want to be in
pain, I don't want to be miserable."
Amber: "Well...You can't always get what you want."