Added pessimistic locking to query builder via 'lock', 'lockForUpdate', and 'sharedLock'.