views:

33

answers:

1

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. Exception 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

A: 

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

Ian Ringrose
Thanks for your answer Ian .But sometime even if the threads are less, the number of connection to database are more .This may be because of application not releasing database connection.
Then your problem is "application not releasing database connection" and you need to fix that.
Ian Ringrose
Yes it can be because of that.But as i am using Spring.Data.Nhibernate12 ,through my application i am not creating and releasing database connection .Session factory of NHibernate doing this for my application .So can it problem of NHibernate or any issue in my application configuration. Because earlier my doubt was that only ,for that i raised a question of Application not releasing database connection and i posted my configuration file also.In my previous question i posted my configuration file also.
Could there be other apps connecting to your database?
Udi Dahan
No only my worker with say 50 worker threads are connecting to it .No other application
Only one application with 50 worker Threads is connecting to database.And if we checks through V$session in database it show that which exe is connected ,those connection persist till some time in INActive state and then goes off.So what request come till the connection exists.Our worker throws exception of Max Pool size(In NHibernate LOG)
Are you by any chance using versioning with NH via the ORA_ROWSCN column? We've had some trouble with NH and distributed transactions outside of NSB when using this style of versioning.
Adam Fyles