当前位置: 首页>>代码示例>>VB.NET>>正文


VB.NET TransactionIsolationLevel枚举代码示例

本文整理汇总了VB.NET中System.EnterpriseServices.TransactionIsolationLevel枚举的典型用法代码示例。如果您正苦于以下问题:VB.NET TransactionIsolationLevel枚举的具体用法?VB.NET TransactionIsolationLevel怎么用?VB.NET TransactionIsolationLevel使用的例子?那么, 这里精选的枚举代码示例或许可以为您提供帮助。


在下文中一共展示了TransactionIsolationLevel枚举的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。

示例1: TransactionAttribute_IsolationAny

' 导入命名空间
Imports System.EnterpriseServices
Imports System.Reflection


' References:
' System.EnterpriseServices

' An instance of this class will inherit its caller's transaction isolation
' level if available. If not, it will use isolation level Serializable.
<Transaction(Isolation := TransactionIsolationLevel.Any)>  _
Public Class TransactionAttribute_IsolationAny
    Inherits ServicedComponent
End Class

' An instance of this class will read only committed data, but non-repeatable
' reads and phantom rows are still possible.
<Transaction(Isolation := TransactionIsolationLevel.ReadCommitted)>  _
Public Class TransactionAttribute_IsolationReadCommitted
    Inherits ServicedComponent
End Class

' An instance of this class will read committed and uncommitted data, so dirty
' reads, non-repeatable reads, and phantom rows are possible.
<Transaction(Isolation := TransactionIsolationLevel.ReadUncommitted)>  _
Public Class TransactionAttribute_IsolationReadUncommitted
    Inherits ServicedComponent
End Class

' An instance of this class will read only committed data and place shared
' locks on the data, preventing other users from modifying it, but other users
' can still insert rows into the data set, so phantom rows are still possible.
<Transaction(Isolation := TransactionIsolationLevel.RepeatableRead)>  _
Public Class TransactionAttribute_IsolationRepeatableRead
    Inherits ServicedComponent
End Class

' An instance of this class will read only committed data and place a range
' lock on the data set, preventing other users from updating or inserting rows
' into the data set until its transaction is complete.
<Transaction(Isolation := TransactionIsolationLevel.Serializable)>  _
Public Class TransactionAttribute_IsolationSerializable
    Inherits ServicedComponent
End Class
开发者ID:VB.NET开发者,项目名称:System.EnterpriseServices,代码行数:44,代码来源:TransactionIsolationLevel


注:本文中的System.EnterpriseServices.TransactionIsolationLevel枚举示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。