Data\Db\DbConnection: relax timeout, persistance

Raised connection timeout, helps when talking to DB servers behind
weak links. Please note that I'm not sure whether this really is a
better default.

While it doesn't matter with local sockets, connection overhead will
have an impact with remote database servers. We have to reconnect with
every single request. Persistent connections seem to be no longer as
errorprone as they used to be, but I'd still refuse to switch them on
by default.

What we need is a config setting for connection persistancy and wizards
strongly suggesting to use this when working with remote db servers.
This commit is contained in:
Thomas Gelf 2014-06-17 09:53:59 +00:00
parent e056310378
commit 7b77083c89
1 changed files with 4 additions and 3 deletions

View File

@ -75,9 +75,10 @@ class DbConnection implements Selectable
);
private static $driverOptions = array(
PDO::ATTR_TIMEOUT => 5,
PDO::ATTR_CASE => PDO::CASE_LOWER,
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
PDO::ATTR_TIMEOUT => 10,
PDO::ATTR_CASE => PDO::CASE_LOWER,
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
// TODO: allow configurable PDO::ATTR_PERSISTENT => true
);
/**