我可以在SQLDatasource中使用连接池吗? [英] Can I use connection pooling with SQLDatasource?
问题描述
阅读有关连接池的文档后,我了解到ADO.NET默认情况下使用连接池。但是我正在使用SQLDatasource的应用程序,我想知道是否可以使用连接池吗?
After reading documentation about Connection Pooling, I learned that ADO.NET uses Connection pooling by default. But the application that I am working with using SQLDatasource and I wonder if I can use Connection Pooling?
如果是,附近有快速教程吗?
If yes, is there a quick tutorial around?
推荐答案
我的猜测是,它将依次使用System.Data.SqlClient以便只要您使用相同的连接字符串,池化就可以正常工作。
My guess would be that it uses System.Data.SqlClient in turn so that as long as you use the same connection string, pooling will work.
我认为您可以进行测试虽然很容易。只需从代码中产生一堆,并附加sql profiler,看看是否有大量调用 sp_reset_connection,每次从池中拉出连接时都会调用该调用。
I think you can test it quite easily though. Just spawn up a bunch of these from code and attach the sql profiler and see if you get alot of calls to "sp_reset_connection" which gets called every time a connection is pulled from the pool.
这篇关于我可以在SQLDatasource中使用连接池吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!