Add table locking to the dbo generation, and correct the versioning to properly commit changes.
Update the locking logic.