Método CreateEnumerationTransaction
Cria uma transação de leitura confirmada por meio da qual enumera alterações do banco de dados.
Namespace: Microsoft.Synchronization.Data
Assembly: Microsoft.Synchronization.Data (em Microsoft.Synchronization.Data.dll)
Sintaxe
'Declaração
Protected Overridable Function CreateEnumerationTransaction As IDbTransaction
'Uso
Dim returnValue As IDbTransaction
returnValue = Me.CreateEnumerationTransaction()
protected virtual IDbTransaction CreateEnumerationTransaction()
protected:
virtual IDbTransaction^ CreateEnumerationTransaction()
abstract CreateEnumerationTransaction : unit -> IDbTransaction
override CreateEnumerationTransaction : unit -> IDbTransaction
protected function CreateEnumerationTransaction() : IDbTransaction
Valor de retorno
Tipo: System.Data. . :: . .IDbTransaction
A transação usada para enumerar alterações do banco de dados.
Exemplos
O exemplo de código a seguir substitui esse método e define uma opção que habilita o comportamento de instantâneo no banco de dados Oracle.
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