会话结果集 [英] Resultset in session

查看:56
本文介绍了会话结果集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将结果集放入会话中有什么缺点?如果不是这样,那是最好的方法.我尝试将其放在 List< Map< Map,String,String>> 中,这不会影响性能吗?

What are the disadvantages of placing resultset in session? if not which is the best possible way.I tried to place it in a List<Map<String,String>>,does it not affect the performance?

推荐答案

ResultSet 表示与数据库的开放连接;通常,您希望获取数据并尽快将连接返回到池中.在会话中存储 ResultSet 可能会导致长时间不关闭连接,这可能耗尽该池或不必要地占用您的数据库资源.

A ResultSet represents an open connection to the database; generally you want to get your data out and return the connection to the pool as quickly as possible. Storing a ResultSet in the session leaves open the possibility that the connection won't be closed for a long time, which could exhaust the pool, or unnecessarily tie up your database resources.

这篇关于会话结果集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆