Database connection after database restart

If you are having a problem using Vault, post a message here.

Moderator: SourceGear

Post Reply
AGBrown
Posts: 34
Joined: Wed Aug 10, 2005 1:42 pm
Contact:

Database connection after database restart

Post by AGBrown » Mon Mar 13, 2006 6:43 am

Firstly, I'd like to say thank you to SourceGear for Vault; it really has been invaluable since we first started using it last year. Props to the product and the team.

This isn't a report about a bug that is stopping us using Vault, I would in fact say it was a minor feature, but the solution is so simple that I thought you might like to consider it. I'm not totally sure if I have accurately diagnosed the problem, and I'm not sure if this is the right forum, so please excuse me if it's in the wrong place.

The situation seems to be reproducible: in SQL server, kill the database connections the web service is using. This simulates a database server restart, or database recovery etc.. If the Vault Web Server is live, and has active connections before this occurs, it then seems to require a restart of that web site/application pool so that new connections are created.

Ideally we would not have to do this web service restart, and the web service would silently take care of the problem.

We have this same problem with our application, except ours is done purposefully as we hot-swap between two data warehouses every few minutes to a shadow while the original is taken offline and updated.

The nature of the problem looks so similar to what we see that I'm guessing (without seeing your code) that you have connections in your connection pool that are active (but closed). When the database processes corresponding to those connections are killed on the sql server the connections in the ASP.NET pool are no longer valid and an error occurs when you next try to execute a SQL command against the connection.

I don't know if this one is on your feature list or not (I don't think it's really a bug). As I said, I'm not even sure that I have accurately explained the problem, but if it is this then we have a solution which you are welcome to have if you need it.

Thanks again for the fantastic product - it makes me grin every time we do a product release.
Andy Brown
<a href="http://www.k2nenergy.com/index.htm" title="See how K2n can reduce your energy consumption and costs">K2n: Energy Monitoring Solutions</a>

jclausius
Posts: 3706
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » Mon Mar 13, 2006 8:55 am

Andy:

You are describing bug 6445 - The connection pooling within the .Net framework still maintains the connection within the pool after SQL Server has a restart.

Personally, I consider this a Microsoft bug, not a Vault bug. The original Server solution was to try to remove the "dead" connection from the connection pool. But, alas, the .Net Connection Pooling class does not provide a way to remove the connection.

We also thought about "holding" the dead connections, but that eventually causes problems in situations where the max pool size is close to allocating the last connection.

In any case, we are open to suggestions on how others may have worked around this problem in the .Net Framework.
Jeff Clausius
SourceGear

AGBrown
Posts: 34
Joined: Wed Aug 10, 2005 1:42 pm
Contact:

Post by AGBrown » Mon Mar 13, 2006 10:40 am

Jeff,

Have sent email and PM, hopefully one will get through, if not then post back here and let me know.

Andy
Andy Brown
<a href="http://www.k2nenergy.com/index.htm" title="See how K2n can reduce your energy consumption and costs">K2n: Energy Monitoring Solutions</a>

Post Reply