-
Will a cursor fetch lock the table
Open a cursor , Fetch the record ,
during this kind of operation , will the specific table be locked and fail
to be updated or select by another session ?
-
Depends on the type of cursor created. At the minimum the row you are fetching is shared locked during select.
-
I think shared lock will not affect
any updation or selection triggered by another session ?
-
shared lock will block update but not select. Because update requires an exclusive lock.
-
Do you mean that while fetching a record in the cursor , the specific row will locked and the updation will be failed or have to wait !
it surprise me ! because this never happens in oracle !
-
You can add nolock hint in your select statement.
-
NOLOCK hint shows all data also uncommited. Oracle shows only commited. So in MSSQL you can use READPAST hint to read only commited transaction.
You Have To Be Happy With What You Have To Be Happy With (KC)
-
Yes it is not same as Oracle, update is blocked by select for the duration of select.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|