Add connection resource locking