Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2003
    Posts
    22

    Question Unanswered: Shared Locks and Checkpoints

    When a program (bound with CS) is holding shared locks and you take a checkpoint, are the outstanding shared locks released?

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1

    Re: Shared Locks and Checkpoints

    Originally posted by RMahajan
    When a program (bound with CS) is holding shared locks and you take a checkpoint, are the outstanding shared locks released?
    I don't think they are -- checkpoint only initiates log update and should not affect state of the transaction that's currently running.
    ---
    "It does not work" is not a valid problem statement.

  3. #3
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    No. Just because a checkpoint is taken and data is written from the log buffer to the active log (or table/index data is written from the bufferpools to disk) does not mean that it is committed. DB2 will backout the data if a rollback occurs.

  4. #4
    Join Date
    Sep 2003
    Posts
    22
    Originally posted by Marcus_A
    No. Just because a checkpoint is taken and data is written from the log buffer to the active log (or table/index data is written from the bufferpools to disk) does not mean that it is committed. DB2 will backout the data if a rollback occurs.
    That sounds true for exclusive locks - I was checking for shared locks...

    When you're reading data using FOR FETCH ONLY (and thereby holding only shared locks), there's nothing to COMMIT, so would the locks still be released if you take the checkpoint(s)?

    Actually, I've seen (using BMC's Mainview for DB2 monitor) the lock count getting reset for exclusive locks when a checkpoint was taken.

    Thanks

  5. #5
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    My apologies. My answer only addressed the issue of commits and not locks. My answer did not address your question.

    However, I would assume that DB2 would not release locks that are needed to ensure data integrity of the database or accuracy of the answer set. Whether or not this applies to the situation you describe, I am not sure.

Posting Permissions

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