Hi,
I am currently experiencing a problem with connection pooling not released by a COM+ server application written in NHibernate. The system is on WIN2003 connecting to MSSQL 2000 database. I turned on the connection pooling on the connection string:
Provider=SQLOLEDB.1;data source=localhost;uid=sa;initial catalog=NhibernateTest;OLE DB Services=-5;password=;Max Pool Size=200;Pooling=true;Connect TimeOut=90
I am testing this by retrievelist about 50 rows of data, go through the list and update the TimeStampCol with current date. Wait for a minute, then repeat the process. Very soon, the program fails with this error
Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool.
COM+ Declaration
Code:
[ClassInterface(ClassInterfaceType.None),
Guid("XXXXXXXXXXXXXXXXXXXXXXXXXXXX),
ProgId("NHibernateCom"),
Transaction(TransactionOption.Supported)]
public class NHibernateCom : ServicedComponent
{
}
For retrieval:
Code:
using(ISession session = NHibernateFactory.GetSession())
{
-- retrieve logic
}
For Update:
Code:
ISession session = NHibernateFactory.GetSession()
session.SaveOrUpdate(obj)
session.Flush();
session.Close();
The server component is called from an winform application, that calls the server once every minute. I noticed from the log that each time the COM+ application is called, it has a different thread id.
Any idea?
Thanks.