Does releasing an inner savepoint make its writes permanent?

Within an outer transaction, RELEASE folds inner work into the parent. A later outer rollback can still undo it.

SQLite example and interpretation

A child task inserts a row and releases its marker. A parent rollback still leaves the table empty. Treat the outermost commit as the durability boundary.

CREATE TABLE t(x);
BEGIN;
SAVEPOINT child;
INSERT INTO t VALUES(9);
RELEASE child;
ROLLBACK;
SELECT count(*) FROM t;

Result [[0]]

中文

释放内层保存点就等于永久提交了吗?

嵌套事务中 RELEASE 将内层工作并入外层。外层事务随后仍能整体回滚。

SQLite 示例与适用条件

子任务写入一行并释放保存点,随后主任务撤销,最终仍是空表。持久化边界应以最外层提交为准。

CREATE TABLE t(x);
BEGIN;
SAVEPOINT child;
INSERT INTO t VALUES(9);
RELEASE child;
ROLLBACK;
SELECT count(*) FROM t;

结果 [[0]]

References / 参考来源

Keep reading / 继续阅读