locked
SyncOrchestrator Transaction Isolation Level RRS feed

  • Question

  • It seems like SyncOrchestrator uses Snapshot Isolation for its transactions.  Is it possible to change this to a different isolation level?

    I am using SqlNotification which conflicts with Snapshot Isolation transactions.

    Thank you,

    Stuart


    Stuart Summers

    Thursday, March 8, 2012 12:43 AM

Answers

All replies

  • try overriding the CreateEnumerationTransaction...

    for an example, have a look at file OracleDbSyncProvider in the sample Oracle Sync Provider: http://code.msdn.microsoft.com/Database-Sync-Oracle-and-037fb083

    • Marked as answer by J. Stuart Thursday, March 8, 2012 6:17 PM
    Thursday, March 8, 2012 1:50 AM
  • Thanks again June!  Worked perfectly.  Here are some code snippets that I used in case someone else runs into the same problem.

    Here is my SqlCeSyncProvider override:

    public class LocalSyncProvider : SqlCeSyncProvider {
            public LocalSyncProvider(string scopeName, SqlCeConnection connection) {
                ScopeName = scopeName;
                Connection = connection;
            }
    
            protected override IDbTransaction CreateEnumerationTransaction() {
                var transaction = (SqlCeTransaction)this.Connection.BeginTransaction(IsolationLevel.ReadCommitted);
                return (transaction);
            }
        }
    And here is my SqlSyncProvider override:
    public class RemoteSyncProvider : SqlSyncProvider {
            public RemoteSyncProvider(string scopeName, SqlConnection connection) {
                ScopeName = scopeName;
                Connection = connection;
            }
    
            protected override IDbTransaction CreateEnumerationTransaction() {
                var transaction = (SqlTransaction)this.Connection.BeginTransaction(IsolationLevel.ReadCommitted);
                return (transaction);
            }
        }


    Stuart Summers

    Thursday, March 8, 2012 6:17 PM