Método CreateApplicationTransaction
Cria uma transação de leitura confirmada por meio da qual aplica alterações ao banco de dados.
Namespace: Microsoft.Synchronization.Data
Assembly: Microsoft.Synchronization.Data (em Microsoft.Synchronization.Data.dll)
Sintaxe
'Declaração
Protected Overridable Function CreateApplicationTransaction As IDbTransaction
'Uso
Dim returnValue As IDbTransaction
returnValue = Me.CreateApplicationTransaction()
protected virtual IDbTransaction CreateApplicationTransaction()
protected:
virtual IDbTransaction^ CreateApplicationTransaction()
abstract CreateApplicationTransaction : unit -> IDbTransaction
override CreateApplicationTransaction : unit -> IDbTransaction
protected function CreateApplicationTransaction() : IDbTransaction
Valor de retorno
Tipo: System.Data. . :: . .IDbTransaction
A transação usada para aplicar alterações ao 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 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