These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: COM+ Connection Pooling not released
PostPosted: Wed Nov 26, 2008 1:47 am 
Newbie

Joined: Mon Jul 21, 2008 2:52 am
Posts: 8
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.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 17, 2008 8:55 pm 
Newbie

Joined: Mon Jul 21, 2008 2:52 am
Posts: 8
Hi all,

I've tracked down the problem to my own code. The session was not closed after retrieving an object. Silly me, for assuming NHibernate retrieval acts the same way as ADO.NET retrieve process where the connection closing is performed automatically.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.