C# 클래스 EnterpriseWebLibrary.DataAccess.DataAccessMethods

A collection of static methods related to data access.
파일 보기 프로젝트 열기: enduracode/enterprise-web-library 1 사용 예제들

공개 메소드들

메소드 설명
RetryOnDeadlock ( System.Action method ) : void

Retries the given operation in the case of a deadlock (when using pessimistic concurrency) or snapshot isolation error (when using optimistic concurrency) until it succeeds. NEVER EVER use this inside a transaction because SQL will automatically kill the transaction in the case of a deadlock, and it's unusable after that point. In the case of Snapshots, the same snapshot from the beginning of the transaction will be used every single time, and so the operation will fail every single time. So, again, DO NOT use this inside a transaction. When using this method, it is important that DeadLockableMethod does not produce any side effects (changing state, sending an email, etc.). Undoing/resetting side effects at the beginning of the block of code to be retried is an acceptable approach here (there is no way to undo certain operations, such as sending an email, obviously).

비공개 메소드들

메소드 설명
CompareCommandConditionTypes ( InlineDbCommandCondition x, InlineDbCommandCondition y ) : int
CreateDbConnectionException ( DatabaseInfo databaseInfo, string action, Exception innerException ) : Exception
CreateStandbyServerModificationException ( ) : Exception
GetDbName ( DatabaseInfo databaseInfo ) : string

메소드 상세

RetryOnDeadlock() 공개 정적인 메소드

Retries the given operation in the case of a deadlock (when using pessimistic concurrency) or snapshot isolation error (when using optimistic concurrency) until it succeeds. NEVER EVER use this inside a transaction because SQL will automatically kill the transaction in the case of a deadlock, and it's unusable after that point. In the case of Snapshots, the same snapshot from the beginning of the transaction will be used every single time, and so the operation will fail every single time. So, again, DO NOT use this inside a transaction. When using this method, it is important that DeadLockableMethod does not produce any side effects (changing state, sending an email, etc.). Undoing/resetting side effects at the beginning of the block of code to be retried is an acceptable approach here (there is no way to undo certain operations, such as sending an email, obviously).
public static RetryOnDeadlock ( System.Action method ) : void
method System.Action
리턴 void