开发者

In a Multi threaded application all threads acquire connection to database .Is this expected or some problem?

开发者 https://www.devze.com 2023-01-15 01:14 出处:网络
I am using NService and NHibernate for my Application. As for NServicebus we define number of threads in configuration file. As per the worker\'s number of threads it works in multithreaded environmen

I am using NService and NHibernate for my Application. As for NServicebus we define number of threads in configuration file. As per the worker's number of threads it works in multithreaded environment. Sometime when all threads are in use and threads acquires connection with database ,it does not allow application to create connection with database. Exce开发者_运维问答ption comes in worker log as Max Pool size reached. And all the threads releases the connection as per the connection timeout.

My question is whether all thread should release connection after use instead of putting them in Inactive state Or It is working fine. If it is working fine what's the way by which I can increase my worker. Because on increasing it give me error of max pool size


I think you should set the number of threads you allow to be no more then the max pool size for database connections.

0

精彩评论

暂无评论...
验证码 换一张
取 消