database session bug fix, in some cases it make ALERT locks