|
|
|
ASE 12.5. Принудительное выставление блокировки
|
|||
|---|---|---|---|
|
#18+
Можно ли в ASE 12.5 выставить шаре-блокировку? Примерно как это делается в Оракле(select for update). Я нашел такой пример: Код: plaintext 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. Но он выставляет иксклюзивную блокировку то есть читать тоже не дает! ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 18.07.2008, 09:41 |
|
||
|
ASE 12.5. Принудительное выставление блокировки
|
|||
|---|---|---|---|
|
#18+
cherrex_Den пишет: > Можно ли в ASE 12.5 выставить шаре-блокировку? Примерно как это делается > в Оракле(select for update). Так в ASE тоже есть SELECT ... FOR UPDATE. Только не SHARED он выставляет, а UPDATE, по-моему. Хотя я могу ошибаться, никогда им не пользовался. Теоретически для FOR BROWSE в ASE и SHARED -а неотпускаемого должно хватать, поскольку SHARED и UPDATE несовместимы. > Я нашел такой пример: > > begin transaction > > update my_table set some_field = some_field where <все чё надо> > > ... > > select * from my_table where <все чё надо> > > .. > > commit > > > Но он выставляет иксклюзивную блокировку то есть читать тоже не дает! напишите вместо UPDATE аналогичный SELECT с фразой at isolation repeatable read в конце. repeatable read | 2 specifies transaction isolation level 2 for the query. Также есть хинт HOLDLOCK from_clause ::= from table_reference [,table_reference]... table_reference ::= table_view_name | ANSI_join table_view_name ::= [[database.]owner.] {{table_name | view_name} [as] [correlation_name] [index {index_name | table_name }] [parallel [degree_of_parallelism]] [prefetch size ][lru | mru]} [holdlock | noholdlock] [readpast] [shared] holdlock makes a shared lock on a specified table or view more restrictive by holding it until the transaction completes (instead of releasing the shared lock as soon as the required data page is no longer needed, whether or not the transaction has completed). The holdlock option applies only to the table or view for which it is specified, and only for the duration of the transaction defined by the statement in which it is used. Setting the transaction isolation level 3 option of the set command implicitly applies a holdlock for each select statement within a transaction. The keyword holdlock is not permitted in a select statement that includes the for browse option. You cannot specify both a holdlock and a noholdlock option in a query. Posted via ActualForum NNTP Server 1.4 ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 18.07.2008, 09:57 |
|
||
|
|

start [/forum/topic.php?fid=55&gotonew=1&tid=2011482]: |
0ms |
get settings: |
8ms |
get forum list: |
15ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
146ms |
get topic data: |
9ms |
get first new msg: |
6ms |
get forum data: |
2ms |
get page messages: |
52ms |
get tp. blocked users: |
2ms |
| others: | 204ms |
| total: | 450ms |

| 0 / 0 |
