[Bug 404010] fix cast exception in mongodb session manager