|
The update statement in my stored procedure pd_Update_NowCom used an exclusive lock and then used waitfor to simulate a long update
Then I want to execute the pd_Select_NewCom stored procedure during the execution of this stored procedure.
exec pd_Update_NewCom '1234'
exec pd_Select_NewCom '0001'
In any case, pd_Select_NewCom will wait for the execution of one of the above stored procedures to complete before executing, so I can't see if the bottom lock works. . . .
And here I have another question: Since the SQL statements are executed synchronously, how can there be a concept of concurrency? (I know this is not right, but I can only think so now)
How can we simulate the situation of multi-user concurrency?
Another problem is
create procedure pd_Update_NewCom
@ID varchar (10)
as
begin transaction
update NewCom (tablockx)
set CompanyName = 'Class 2 of Xihua University Network College'
where CompanyID = @ ID
waitfor delay '00: 00: 10 '
commit transaction
Here is the lock released after the transaction is completed, or is it released after the update statement is completed? ? |
|