rdbms: Add IDatabase::cancelAtomic()
authorBrad Jorsch <bjorsch@wikimedia.org>
Sat, 17 Mar 2018 21:59:56 +0000 (17:59 -0400)
committerAaron Schulz <aschulz@wikimedia.org>
Thu, 22 Mar 2018 05:57:42 +0000 (05:57 +0000)
commit52aeaa7a5fb0c233caa9f7815882f7a99cf4ece3
tree22a0268e94ecf29353c0570fe856e509cba602df
parent6c1cd929cb1c1fe0bcbde9fea59a1ff9bc2d9c6f
rdbms: Add IDatabase::cancelAtomic()

Atomic sections are currently useful if you want to wrap some SQL
statements in a transaction when you might be called from inside someone
else's transaction, and you expect the caller to roll back everything if
you fail.

But there are some cases where you want to allow the caller to recover
from errors, in which case you need to roll back just the atomic
section. Savepoints are supported by all our databases and can be used
for this purpose, so let's do so.

Bug: T188660
Change-Id: Iee548619df89fd7fbd581b01106b8b41d3df71cc
RELEASE-NOTES-1.31
includes/libs/rdbms/database/DBConnRef.php
includes/libs/rdbms/database/Database.php
includes/libs/rdbms/database/DatabaseMssql.php
includes/libs/rdbms/database/IDatabase.php
tests/phpunit/includes/libs/rdbms/database/DatabaseSQLTest.php