Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
返回具有指定隔离级别的事务对象。
Public Shadows Function BeginTransaction( ByVal isolationLevel As IsolationLevel ) As ULTransaction
public new ULTransaction BeginTransaction(IsolationLevel isolationLevel)
isolationLevel 事务所需的隔离级别。UltraLite.NET 仅支持 System.Data.IsolationLevel.ReadUncommitted 值和 ReadCommitted 值。
一个表示新事务的 ULTransaction 对象。
ULException 类 连接已关闭或指定了不支持的隔离级别。
InvalidOperationException ULConnection 类不支持并行事务。
将与事务对象关联的命令作为单个事务执行。使用 ULTransaction.Commit 方法或 ULTransaction.Rollback 方法终止事务。
要将命令与事务对象相关联,请使用 ULCommand.Transaction 属性。当前事务会自动与 ULConnection.CreateCommand 方法所创建的命令相关联。
缺省情况下,连接不使用事务,且所有命令均会在执行时自动提交。提交或回退当前事务后,连接即会恢复为自动提交模式和前一个隔离级别,直至下一次调用 BeginTransaction 方法。
与 ADO.NET 的 IsolationLevel 文档相比,UltraLite 的每个隔离级别定义稍有不同。
这是 System.Data.IDbConnection.BeginTransaction(System.Data.IsolationLevel) 方法和 System.Data.Common.DbConnection.BeginTransaction(System.Data.IsolationLevel) 方法的强类型版本。