Connection hangs after time of inactivity

前端 未结 5 971
耶瑟儿~
耶瑟儿~ 2020-12-31 18:21

In my application, Spring manages connection pool for database access. Hibernate uses these connections for its queries. At first glance, I have no problems with the pool: i

5条回答
  •  别那么骄傲
    2020-12-31 19:09

    Check the config of your pool implementation. Usually, it's Apache DBCP which has a timeout for each connection after it will close it.

    In your code, you shouldn't keep connections around. Get one, use it, close it immediately. The pool will make sure that this doesn't cost too much.

提交回复
热议问题