|
|
|
sp_getapplock
|
|||
|---|---|---|---|
|
#18+
Всем добрый день. Решился я тут попробовать как работают sp_getapplock. Например: Код: plaintext Далее, смотрим чего получилось: Код: plaintext 1. 2. 3. 4. 5. 6. 7. 8. Все замечательно, все правильно. Проблема заключается в том, что получить какую-либо информацию о поставленной блокировке можно только по имени ресурса (в данном примере 'RESO6c9e30b4'), которое вычисляется путем хэширования оригинального имени. Можно ли каким-либо способом этот хэш вычислить? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 23.07.2002, 13:20:26 |
|
||
|
sp_getapplock
|
|||
|---|---|---|---|
|
#18+
Не надо ничего вычислять. Вы как с обычными блокировками работаете? Вот так же и с этими надо. Не забывайте, что есть set lock_timeout. The LOCK_TIMEOUT setting allows an application to set a maximum time that a statement waits on a blocked resource. When a statement has waited longer than the LOCK_TIMEOUT setting, the blocked statement is canceled automatically, and error message 1222 "Lock request time-out period exceeded" is returned to the application. However, any transaction containing the statement is not rolled back or canceled by SQL Server. Therefore, the application must have an error handler that can trap error message 1222. If an application does not trap the error, it can proceed unaware that an individual statement within a transaction has been canceled, and errors can occur because statements later in the transaction may depend on the statement that was never executed. Implementing an error handler that traps error message 1222 allows an application to handle the time-out situation and take remedial action for example, automatically resubmitting the statement that was blocked, or rolling back the entire transaction. To determine the current LOCK_TIMEOUT setting, execute the @@LOCK_TIMEOUT function, for example: DECLARE @Timeout int SELECT @Timeout = @@lock_timeout SELECT @Timeout GO See BOL for further info. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 24.07.2002, 20:03:01 |
|
||
|
|

start [/forum/topic.php?fid=46&msg=32038224&tid=1821589]: |
0ms |
get settings: |
8ms |
get forum list: |
15ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
35ms |
get topic data: |
9ms |
get forum data: |
2ms |
get page messages: |
34ms |
get tp. blocked users: |
1ms |
| others: | 217ms |
| total: | 327ms |

| 0 / 0 |
