Forum Stats

  • 3,840,134 Users
  • 2,262,571 Discussions
  • 7,901,154 Comments

Discussions

Running checkpoint w/o locks

529636
529636 Member Posts: 39
edited Aug 30, 2006 11:44AM in Berkeley DB
If a database environment is configured w/o locking is it possible for data corruption to occur if one thread is executing Environment.checkpoint() while others are concurrently creating, committing, and aborting transactions?

Comments

  • 529636
    529636 Member Posts: 39
    To answer my own question; checkpointing is safe even w/o the lock manager.
  • 512799
    512799 Member Posts: 494
    H,
    while others are concurrently creating, committing, and aborting transactions?
    This scenario requires locking (concurrent committing, updating and aborting transactions).

    Ron
  • 529636
    529636 Member Posts: 39
    I've replaced the lock manager w/ database level locking using java.util.concurrent.locks.ReadWriteLock objects. I've written a test case where a single thread continuously calls Environment.checkpoint() w/ the force option set. 32 other threads busy themselves creating and committing transactions at the same time the checkpointing thread is running. So at any given moment at most 2 threads are concurrently changing the environment, the checkpoint thread and one of the 32 doing a commit. So far I haven't had any data corruption so I've concluded that checkpointing can occur concurrently w/ environmental changes.
This discussion has been closed.