use table locking to ensure proper serialization