home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / vms / 13689 < prev    next >
Encoding:
Internet Message Format  |  1992-08-15  |  1.9 KB

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