Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select ..FOR UPDATE is to Oracle as _____ is to SQLServe
Message
From
17/02/1999 09:57:03
 
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00187943
Message ID:
00188373
Views:
26
Neahh..
ok. that's great...
I see what you mean now.

I need to lock()
Then allow user to edit (They may take ten minutes to edit
so it must be locked..)
Then released after the update...

SO I do...
?SQLEXEC(h,'SELECT * FROM dbstruct (ROWLOCK HOLDLOCK) WHERE recno=1759')

Then I see...3 Locks on my objectid...
8 8 1671677003 1 PAG 1:3103 IS GRANT
8 8 1671677003 0 TAB IS GRANT
8 8 1671677003 1 KEY (df06df060000) IS-S GRANT

now I ignore the cursor from the above stement (i just wanted the lock...
Do the edit and update
Then SQLCOMMIT(). To close the locks...

This is fine.
But..
If i go to another machine...While the first machine has locked the record..
Then issue...
?SQLEXEC(h,'SELECT * FROM dbstruct (ROWLOCK HOLDLOCK) WHERE recno=1759')
know I have...

8 8 1671677003 1 PAG 1:3103 IS GRANT
8 8 1671677003 0 TAB IS GRANT
8 8 1671677003 1 KEY (df06df060000) IS-S GRANT
12 8 1671677003 1 PAG 1:3103 IS GRANT
12 8 1671677003 0 TAB IS GRANT
12 8 1671677003 1 KEY (df06df060000) IS-S GRANT

a) What gives how can I have two locks on the same row..What is locked?
_I logged in as same user both times... Could that be why?

b)What does it mean with these page locks?
can it mean that the next record is also locked?

c)How can I test for a lock on this recno=1759...i can see how to do it on the table...with sp_lock but how about checking this row...




Thanks for your help...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform