home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!gatech!bloom-beacon!eru.mt.luth.se!lunic!sunic!seunet!enea!sommar
- From: sommar@enea.se (Erland Sommarskog)
- Newsgroups: comp.os.vms
- Subject: Re: RDB Locking
- Message-ID: <1992Aug15.215911.6545@enea.se>
- Date: 15 Aug 92 21:59:11 GMT
- References: <920810221634.19a3@CSVAX.COSC.BROCKU.CA>
- Organization: Enea Data AB
- Lines: 34
-
- MCCARTHYD@CSVAX.COSC.BROCKU.CA writes:
- >When a read/write transaction is started reserving a table for shared write,
- >and the same transaction is started by another process, locks are encountered
- >when attempting to select a set of rows even when neither of the transactions
- >has performed any work.
- >...
- >It appears that if the data is accessed without use of the indexes, a lock
- >conflict is encountered even though there are no locks imposed due to work
- >performed by the other session(process).
-
- Your observation is entirely correct, and what is you see is
- indeed the expected behaviour.
-
- What is happening is that when RDB decides to do search a
- relation sequentially, it enforces protected mode even if
- you said shared. And as you may know, in protected mode
- the entire relation is locked.
-
- I can't off-hand say where this is documented. I think it is in
- the discussion on locking modes in the regular manual, but it may
- in some more obscure place, in worst case the RDB Internals course
- material.
-
- In any case, the behaviour is easy to understand intuitively. Assume
- that RDB really did what you told it, and went ahead searching
- sequentially and locking each record individually (as shared mode
- implies). Since RDB is very rabid about consistency, it would have
- to look every single record until it found the ones you were looking
- for. And if you didn't say FOR FIRST (in RDO) or LIMIT TO (in SQL)
- that means every single record in the relation. So this would give
- you the same result as you saw - but at a severe performance penalty.
- --
- Erland Sommarskog - ENEA Data, Stockholm - sommar@enea.se
- Life is wonderful when the wonderlife is full
-