I have windows service have two method which are inserting data to the same table at the same time.but at the time of insert it threw the exception.how i can make lock on such situation.
t开发者_如何学Chank you in advance
if its update statement, i would suggest BEGIN TRANSACTION with READ COMMIITED isolation level. but since its insert, u might want to create extra table act like a queue. Insert everything in new table and after that u can run your validation.
精彩评论