gpt4 book ai didi

.net - sqlite:SQLiteTransaction 和 SQLiteTransaction2 有什么区别

转载 作者:行者123 更新时间:2023-12-02 00:13:08 28 4
gpt4 key购买 nike

System.Data.SQLite 有两个不同的事务类:SQLiteTransaction 和 SQLiteTransaction2

有人知道 SQLiteTransaction 和 SQLiteTransaction2 之间的区别吗?

最佳答案

SQLiteTransaction2 支持嵌套事务,而 SQLiteTransaction 不支持。

查看嵌入式类文档:

//
// Summary:
// SQLite implementation of DbTransaction that does support nested transactions.
public sealed class SQLiteTransaction2 : SQLiteTransaction
{
//
// Summary:
// Commits the current transaction.
public override void Commit();
//
// Summary:
// Attempts to start a transaction. An exception will be thrown if the transaction
// cannot be started for any reason.
//
// Parameters:
// deferredLock:
// TRUE to defer the writelock, or FALSE to lock immediately
protected override void Begin(bool deferredLock);
//
// Summary:
// Disposes the transaction. If it is currently active, any changes are rolled back.
protected override void Dispose(bool disposing);
//
// Summary:
// Issue a ROLLBACK command against the database connection, optionally re-throwing
// any caught exception.
//
// Parameters:
// throwError:
// Non-zero to re-throw caught exceptions.
protected override void IssueRollback(bool throwError);
}

关于.net - sqlite:SQLiteTransaction 和 SQLiteTransaction2 有什么区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47990313/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com