R
Rob Thompson
Hi,
We are thinking of using ADO.NET to implement transactions on our
SqlConnections, but would like to know how ADO.NET and SqlServer handle the
situation when the connection gets broken.
We have a client application in one location and a SqlServer DB in another
location. We have tested the commit and rollback actions on a good
connection and everything works great! When the connection gets dropped
after the BeginTransaction method gets called however SqlServer seems to
take a while before realising the connection has been dropped and rolling
back the transaction (5 minutes). This means that the records updated inside
the transaction before the connection was dropped remain locked for 5
minutes before being rolled back.
Is there any way we can configure or control the timeout period?
Here is a basic code snippet:
try
{
db.OpenConnectionAndBeginTransaction();
db.ExecuteSomeSQL();
db.CommitTransaction();
}
catch(Exception)
{
db.RollbackTransaction();
throw;
}
Any help would be greatly appreciated.
Thanks,
Rob
We are thinking of using ADO.NET to implement transactions on our
SqlConnections, but would like to know how ADO.NET and SqlServer handle the
situation when the connection gets broken.
We have a client application in one location and a SqlServer DB in another
location. We have tested the commit and rollback actions on a good
connection and everything works great! When the connection gets dropped
after the BeginTransaction method gets called however SqlServer seems to
take a while before realising the connection has been dropped and rolling
back the transaction (5 minutes). This means that the records updated inside
the transaction before the connection was dropped remain locked for 5
minutes before being rolled back.
Is there any way we can configure or control the timeout period?
Here is a basic code snippet:
try
{
db.OpenConnectionAndBeginTransaction();
db.ExecuteSomeSQL();
db.CommitTransaction();
}
catch(Exception)
{
db.RollbackTransaction();
throw;
}
Any help would be greatly appreciated.
Thanks,
Rob