see http://stackoverflow.com/questions/312702/is-it-safe-to-keep-database-connections-open-for-long-time
其中的一个回复很有启发。如果不是这个功能要求7*24在运行的话,就没有必要保持长时间的数据库连接了。
If you are talking about a client/server application, I would recommend closing each connection as soon as you are done using it. While each individual application instance might take a small performance hit opening the connection, your application as a
whole will scale better.
本文探讨了在非7*24运行需求场景下,数据库连接保持长时间打开的必要性及性能影响。建议非持续运行应用关闭连接以提升整体性能。
5970

被折叠的 条评论
为什么被折叠?



