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:
parent
e056310378
commit
7b77083c89
|
@ -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
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue