Use Lock class from DbDriver.