Comments please
Posted in 2006
Topics: Transactions, Locking & Isolation, Logging & Checkpoints
>From a developer..... We perform locks on a table such as the following: update <table> set <col> = <col>; within transactions in order to create a lock on a row (to prevent deadlock/concurrency issues). These updates are not shown in the logical logs, presumably because it's not required for rolling forward on recovery. Regards Colin There are 10 types of people in the world, those that understand binary and those that don't _________________________________________________________________ Download the new Windows Live Toolbar, including Desktop search! http://toolbar.live.com/?mkt=en-gb
Colin Dawson wrote:
>> From a developer.....
>
>
> We perform locks on a table such as the following:
>
> update <table> set <col> = <col>;
>
> within transactions in order to create a lock on a row (to prevent
> deadlock/concurrency issues).
>
> These updates are not shown in the logical logs, presumably because it's
> not required for rolling forward on recovery.
Probably the engine recognizes that the operation is noop and doesn't log
it. You know that you can do:
SELECT rowid FROM <table> WHERE <filters> FOR UPDATE;
with a CURSOR and it will maintain a lock on the current cursor row until
the cursor is moved or the transaction is committed or rolled back
(depending on the isolation level) instead of the update.
Art S. Kagel
Colin Dawson wrote:
>> From a developer.....
>
>
> We perform locks on a table such as the following:
>
> update <table> set <col> = <col>;
>
> within transactions in order to create a lock on a row (to prevent
> deadlock/concurrency issues).
>
> These updates are not shown in the logical logs, presumably because it's
> not required for rolling forward on recovery.
Probably the engine recognizes that the operation is noop and doesn't log
it. You know that you can do:
SELECT rowid FROM <table> WHERE <filters> FOR UPDATE;
with a CURSOR and it will maintain a lock on the current cursor row until
the cursor is moved or the transaction is committed or rolled back
(depending on the isolation level) instead of the update.
Art S. Kagel