mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
API CHANGE Added abstract transaction methods to Database (migrated from MySQLDatabase): supportsTransactions(), transactionStart(), transactionSavepoint(), transactionRollback(), transactionEnd()
This commit is contained in:
parent
002e40bd79
commit
b70ff87658
@ -786,6 +786,35 @@ abstract class SS_Database {
|
|||||||
*/
|
*/
|
||||||
abstract function datetimeDifferenceClause($date1, $date2);
|
abstract function datetimeDifferenceClause($date1, $date2);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Does this database support transactions?
|
||||||
|
*
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
abstract function supportsTransactions();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Start a prepared transaction
|
||||||
|
* See http://developer.postgresql.org/pgdocs/postgres/sql-set-transaction.html for details on transaction isolation options
|
||||||
|
*/
|
||||||
|
abstract function transactionStart($transaction_mode=false, $session_characteristics=false);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Create a savepoint that you can jump back to if you encounter problems
|
||||||
|
*/
|
||||||
|
abstract function transactionSavepoint($savepoint);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Rollback or revert to a savepoint if your queries encounter problems
|
||||||
|
* If you encounter a problem at any point during a transaction, you may
|
||||||
|
* need to rollback that particular query, or return to a savepoint
|
||||||
|
*/
|
||||||
|
abstract function transactionRollback($savepoint=false);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Commit everything inside this transaction so far
|
||||||
|
*/
|
||||||
|
abstract function transactionEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user