Quantcast
Channel: SQL Server Database Engine forum
Viewing all articles
Browse latest Browse all 12963

If a database is locked exclusivley does the T-SQL statment get queued and executed when the database is ready?

$
0
0
I have a Database that must be locked exclusively from time to time for various INSERTS.  I am noticing that sometimes I get multiple entries inserted when the database becomes unlocked.

My application attempts to execute a INSERT and if the database is locked I loop in my program a few seconds and try again.  I am noticing that sometimes I might get 2, 3, 4 records inserted.  Is it possible that SQL Server is taking the first TSQL transaction that failed due to the DB being locked and Queuing it to be run after the DB becomes unlocked?

Any help explaining this would greatly be appreciated.

Viewing all articles
Browse latest Browse all 12963


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>