Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Record Locking
On 15 Aug 1997 15:45:12 GMT, "Richard D. Beynon, Jr." <rbeynon_at_stratusgroup.com> wrote:
>I need some edification on how Oracle handles record locking.
>
>Can you get a read-lock if a write-lock exists on a record and vice-versa.
No, but for the simple reason that read-locks on blocks/rows don't exist in Oracle. Share locks do, but only on the object level. We'll get a share lock on a table to ensure DDL mods to the table can't take place while we are depending on the table, but at the block/row level-- no share locks.
>- can a write lock be obtained after a read lock has been set?
doesn't apply.
>- If so, will the read view be refreshed?
again, same as above...
>- can dirty reads be done for queries & reports while a write lock is set?
dirty reads are not needed (nor desirable). Oracle supports a concept called consistent read. this allows a query to "read through locks", get the correct, consistent answer, and not read 'dirty data'.
Readers do not block writes (no read locks) Writers to not block reads (readers can 'read through locks' but this is *not* a dirty read)
Only writes to the SAME exact row will block in normal circumstances.
Please check out the server concepts manual, chapter 10 on data concurrency for
more information.
>
>Thanks for the help.
Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Bethesda MD
http://govt.us.oracle.com/ -- downloadable utilities
![]() |
![]() |