I have found the possible reasons may be,
1. I didn't set the connection timeout parameters for the connection pool
2. The main scenario is, hibernate connection pool keeps the opened connection for a long time and mysql closes it when its idle time reaches for the opened connection.
3. When hibernate trys to do something with this connection which is closed by mysql got the exception.
Possible solution is, try to define the idle timeout value for the connection in hibernate lower than the mysql system connection idle timeout. This is very easy in hibernate.cfg.xml file to define the connection pool parameters and a lot of web resources can be found by google how to do it.
Thanks. Hope it will help you.
No comments:
Post a Comment