C
Cordell Lawrence
Okay guys, this is more of a comment in case anyone else has the same issue
and decides to do a search for the problem.
Short history:
We have build a system that performs quite a lot of database calls (on
multiple threads) both to retrieve and write data. Our application's data
quickly grew then exceptions started being thrown in our data access code,
SQL Server was terminating different processes with -> "Transaction was
deadlocked on lock resources with another process and has been chosen as the
deadlock victim". So I went attempting to investigate the connection pool of
ADO.NET with some test applications.
Wrote a simple app to queue up sereral calls to the DB on the thread
pool to do some simple work.
Issue:
After the specified "max connections" for connections in the connection
pool were reached the application kept locking up. Over and over again ...
try as I might. I said to myself ... self ! why isn't this working!? ... the
connections should be going back to the pool when the db job was done ... I
saw the connection being closed. I even "Dispose"-ed of the connection and
saw the disposed event handler get called.
The problem:
It "seemes" that the issues was setting SQL Server debugging in
VisualStudio.NET project options to TRUE. When this option is turned on it
seems that connections arn't really returned to the connection pool when
they are closed by the application.
Has anyone else out there had this issue? Am I correct in asuming the above?
FYI: The "Transaction deadlock..." issues were solved using SQL locking
hints and paying closer attention to Transaction isolation levels and locks
during operations. There is tonnes of posts in this news group about that
already.
Cordell Lawrence [[email protected]]
Teleios Systems Ltd. [www.teleios-systems.com]
and decides to do a search for the problem.
Short history:
We have build a system that performs quite a lot of database calls (on
multiple threads) both to retrieve and write data. Our application's data
quickly grew then exceptions started being thrown in our data access code,
SQL Server was terminating different processes with -> "Transaction was
deadlocked on lock resources with another process and has been chosen as the
deadlock victim". So I went attempting to investigate the connection pool of
ADO.NET with some test applications.
Wrote a simple app to queue up sereral calls to the DB on the thread
pool to do some simple work.
Issue:
After the specified "max connections" for connections in the connection
pool were reached the application kept locking up. Over and over again ...
try as I might. I said to myself ... self ! why isn't this working!? ... the
connections should be going back to the pool when the db job was done ... I
saw the connection being closed. I even "Dispose"-ed of the connection and
saw the disposed event handler get called.
The problem:
It "seemes" that the issues was setting SQL Server debugging in
VisualStudio.NET project options to TRUE. When this option is turned on it
seems that connections arn't really returned to the connection pool when
they are closed by the application.
Has anyone else out there had this issue? Am I correct in asuming the above?
FYI: The "Transaction deadlock..." issues were solved using SQL locking
hints and paying closer attention to Transaction isolation levels and locks
during operations. There is tonnes of posts in this news group about that
already.
Cordell Lawrence [[email protected]]
Teleios Systems Ltd. [www.teleios-systems.com]