MDL-36211 do not lock sessions for guests and not-logged-in users

This commit is contained in:
Petr Škoda 2012-10-25 17:12:53 +08:00 committed by Petr Škoda
parent 2d7c5eeeea
commit 46a86dbbc2
8 changed files with 47 additions and 7 deletions

View file

@ -341,11 +341,11 @@ abstract class moodle_database {
}
$this->force_transaction_rollback();
}
if ($this->used_for_db_sessions) {
// this is needed because we need to save session to db before closing it
session_get_instance()->write_close();
$this->used_for_db_sessions = false;
}
// Always terminate sessions here to make it consistent,
// this is needed because we need to save session to db before closing it.
session_get_instance()->write_close();
$this->used_for_db_sessions = false;
if ($this->temptables) {
$this->temptables->dispose();
$this->temptables = null;