RelationalSyncProvider.CreateApplicationTransaction Method

Creates a read-committed transaction over which to apply changes to the database.

Namespace:  Microsoft.Synchronization.Data
Assembly:  Microsoft.Synchronization.Data (in Microsoft.Synchronization.Data.dll)

protected virtual IDbTransaction CreateApplicationTransaction()

Return Value

Type: System.Data.IDbTransaction
The transaction used to apply changes to the database.

The following code example overrides this method and sets an option that enables snapshot behavior in the Oracle database.

protected override IDbTransaction CreateApplicationTransaction()
        {
            OracleTransaction trans = (OracleTransaction)this.Connection.BeginTransaction();
            new OracleCommand("set transaction read only", (OracleConnection)this.Connection, trans).ExecuteNonQuery();
            return trans;        
        }


Protected Overloads Overrides Function CreateApplicationTransaction() As IDbTransaction
    Dim trans As OracleTransaction = DirectCast(Me.Connection.BeginTransaction(), OracleTransaction)
    New OracleCommand("set transaction read only", DirectCast(Me.Connection, OracleConnection), trans).ExecuteNonQuery() 
    Return trans
End Function


Show: