issue #20154: Fix locking session problem.