Results 1 to 2 of 2

Thread: Locking Question

  1. #1
    Join Date
    Nov 2004
    Location
    Hilversum - The Netherlands
    Posts
    1,054

    Default Locking Question

    I`m doing some research about locking for a blogentry and I can`t find the answer to a question.

    The question is:
    If the isolation level is serializable (and you are working with a database) is the complete table locked when it is queried (for the duration of the transaction) ?

    For repeatable read you get row locks, but it allows phantom reads. The only way to make sure you don`t get phantom reads (in the serialized isolation level) is by having a complete table lock.

    Or could it be that it totally up to the database implementation what is locked?
    Last edited by Alarmnummer; Feb 17th, 2006 at 02:23 AM.

  2. #2
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    Or could it be that it totally up to the database implementation what is locked?
    Not really an answer but I think each database will have its own implementation in order to squeeze performance. You can indicate the appropriate behavior by setting certain parameters (possible through jdbc when your application starts and before any transactions are started).
    At least mysql works this way: http://dev.mysql.com/doc/refman/5.0/...locks-set.html
    AFAIK, oracle has a similar mechanism (I can only recall the ROW_LOCKING parameter).
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •