flipped transaction and advisory lock to prevent deadlocks