Savepoint

savepoint是在数据库事务处理中实现“子事务”(subtransaction),也称为嵌套事务的方法。事务可以回滚到savepoint而不影响savepoint创建前的变化。不需要放弃整个事务。

SQL语言国际标准中,SAVEPOINT name语句声明一个savepoint。ROLLBACK TO SAVEPOINT name语句回滚到savepoint。RELEASE SAVEPOINT name将使得命名的savepoint被放弃,但不影响其他savepoint。ROLLBACKCOMMIT导致所有savepoint被放弃。

支持savepoint的数据库有:PostgreSQLOracle数据库Microsoft SQL ServerMySQLDB2SQLite(从3.6.8)、FirebirdH2数据库Informix(从11.50xC3)。

This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.