X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/categories/modifier.php?a=blobdiff_plain;f=includes%2Flibs%2Frdbms%2Fdatabase%2FIDatabase.php;h=a5392c81cbbfd8106b7cea4b0cec42cff6243187;hb=90b02397d0963970a00d4be798fab76218a38a87;hp=8af73e07c737d89fe524623fe9ec9b41ad2d39bb;hpb=d395dfb039fce787c9e4acbfeecbfe0ec372a9be;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/rdbms/database/IDatabase.php b/includes/libs/rdbms/database/IDatabase.php index 8af73e07c7..a5392c81cb 100644 --- a/includes/libs/rdbms/database/IDatabase.php +++ b/includes/libs/rdbms/database/IDatabase.php @@ -513,6 +513,10 @@ interface IDatabase { * Run an SQL query and return the result. Normally throws a DBQueryError * on failure. If errors are ignored, returns false instead. * + * If a connection loss is detected, then an attempt to reconnect will be made. + * For queries that involve no larger transactions or locks, they will be re-issued + * for convenience, provided the connection was re-established. + * * In new code, the query wrappers select(), insert(), update(), delete(), * etc. should be used where possible, since they give much better DBMS * independence and automatically quote or validate user input in a variety @@ -1424,6 +1428,8 @@ interface IDatabase { /** * Determines if the last failure was due to a deadlock * + * Note that during a deadlock, the prior transaction will have been lost + * * @return bool */ public function wasDeadlock(); @@ -1431,17 +1437,21 @@ interface IDatabase { /** * Determines if the last failure was due to a lock timeout * + * Note that during a lock wait timeout, the prior transaction will have been lost + * * @return bool */ public function wasLockTimeout(); /** - * Determines if the last query error was due to a dropped connection and should - * be dealt with by pinging the connection and reissuing the query. + * Determines if the last query error was due to a dropped connection + * + * Note that during a connection loss, the prior transaction will have been lost * * @return bool + * @since 1.31 */ - public function wasErrorReissuable(); + public function wasConnectionLoss(); /** * Determines if the last failure was due to the database being read-only. @@ -1450,6 +1460,15 @@ interface IDatabase { */ public function wasReadOnlyError(); + /** + * Determines if the last query error was due to something outside of the query itself + * + * Note that the transaction may have been lost, discarding prior writes and results + * + * @return bool + */ + public function wasErrorReissuable(); + /** * Wait for the replica DB to catch up to a given master position *