* API: if re-connect to database fails for an existing session, stop execution with an exception, as otherwise eg. preferences can get lost

This commit is contained in:
Ralf Becker 2013-06-20 13:30:58 +00:00
parent 025c6a4c22
commit 78efd4a604

View File

@ -450,7 +450,11 @@ class egw_db
$this->Link_ID =& $GLOBALS['egw']->ADOdb; $this->Link_ID =& $GLOBALS['egw']->ADOdb;
} }
} }
if (!$this->Link_ID->isConnected()) $this->Link_ID->Connect(); if (!$this->Link_ID->isConnected() && !$this->Link_ID->Connect())
{
$Host = preg_replace('/password=[^ ]+/','password=$Password',$this->Host); // eg. postgres dsn contains password
throw new egw_exception_db_connection("ADOdb::$connect($Host, $this->User, \$Password, $this->Database) reconnect failed.");
}
if ($new_connection) if ($new_connection)
{ {