Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当您使用动态生成连接字符串的自定义连接提供程序时,是否启用了连接池?用户是连接字符串中唯一改变的数据,通过时间可以为同一个用户打开许多会话。顺便说一句,我使用 NHibernate 3.0 连接到 SQL Server 2005 中的数据库。
无论连接字符串如何生成,都使用 ADO.NET 池,但是要将连接字符串绑定到池,字符串必须相同,因此如果用户名更改,则不满足此条件,结果您将为每个用户从不同的池中获取连接。