Sdílet prostřednictvím


RelationalSyncProvider.CreateEnumerationTransaction Method

When overridden in a derived class, enables an explicit transaction to be created in which to enumerate changes from an Oracle database.

This method is not CLS-compliant.  

Namespace: Microsoft.Synchronization.Data
Assembly: Microsoft.Synchronization.Data (in microsoft.synchronization.data.dll)

Syntax

'Declaration
Protected Overridable Function CreateEnumerationTransaction As IDbTransaction
'Usage
Dim returnValue As IDbTransaction

returnValue = Me.CreateEnumerationTransaction
protected virtual IDbTransaction CreateEnumerationTransaction ()
protected:
virtual IDbTransaction^ CreateEnumerationTransaction ()
protected IDbTransaction CreateEnumerationTransaction ()
protected function CreateEnumerationTransaction () : IDbTransaction

Remarks

This method is used to create a transaction on which you can set the appropriate isolation level.

Example

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

protected override IDbTransaction CreateEnumerationTransaction()
        {
            OracleTransaction trans = (OracleTransaction)this.Connection.BeginTransaction();
            new OracleCommand("set transaction read only", (OracleConnection)this.Connection, trans).ExecuteNonQuery();
            return trans;        
        }
Protected Overloads Overrides Function CreateEnumerationTransaction() 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

See Also

Reference

RelationalSyncProvider Class
RelationalSyncProvider Members
Microsoft.Synchronization.Data Namespace