TransactionManager.Reenlist(Guid, Byte[], IEnlistmentNotification) Método
Definição
Reinscreve um participante durável em uma transação.Reenlists a durable participant in a transaction.
public:
static System::Transactions::Enlistment ^ Reenlist(Guid resourceManagerIdentifier, cli::array <System::Byte> ^ recoveryInformation, System::Transactions::IEnlistmentNotification ^ enlistmentNotification);
public:
static System::Transactions::Enlistment ^ Reenlist(Guid manager, cli::array <System::Byte> ^ recoveryInfo, System::Transactions::IEnlistmentNotification ^ notification);
public static System.Transactions.Enlistment Reenlist (Guid resourceManagerIdentifier, byte[] recoveryInformation, System.Transactions.IEnlistmentNotification enlistmentNotification);
public static System.Transactions.Enlistment Reenlist (Guid manager, byte[] recoveryInfo, System.Transactions.IEnlistmentNotification notification);
static member Reenlist : Guid * byte[] * System.Transactions.IEnlistmentNotification -> System.Transactions.Enlistment
static member Reenlist : Guid * byte[] * System.Transactions.IEnlistmentNotification -> System.Transactions.Enlistment
Public Shared Function Reenlist (resourceManagerIdentifier As Guid, recoveryInformation As Byte(), enlistmentNotification As IEnlistmentNotification) As Enlistment
Public Shared Function Reenlist (manager As Guid, recoveryInfo As Byte(), notification As IEnlistmentNotification) As Enlistment
Parâmetros
- resourceManagerIdentifiermanager
- Guid
Um Guid que identifica o gerenciador de recursos exclusivamente.A Guid that uniquely identifies the resource manager.
- recoveryInformationrecoveryInfo
- Byte[]
Contém informações adicionais de recuperação.Contains additional information of recovery information.
- enlistmentNotificationnotification
- IEnlistmentNotification
Um objeto de recurso que implementa IEnlistmentNotification para receber notificações.A resource object that implements IEnlistmentNotification to receive notifications.
Retornos
Um Enlistment que descreve a inscrição.An Enlistment that describes the enlistment.
Exceções
recoveryInformation é inválido.recoveryInformation is invalid.
- ou --or-
As informações do Gerenciador de Transação em recoveryInformation não correspondem ao gerenciador de transação configurado.Transaction Manager information in recoveryInformation does not match the configured transaction manager.
- ou --or-
RecoveryInformation não é reconhecido por System.Transactions.RecoveryInformation is not recognized by System.Transactions.
RecoveryComplete(Guid) já foi chamado para o resourceManagerIdentifier especificado.RecoveryComplete(Guid) has already been called for the specified resourceManagerIdentifier. A nova inscrição foi rejeitada.The reenlistment is rejected.
O resourceManagerIdentifier não corresponde ao conteúdo das informações de recuperação especificadas em recoveryInformation.The resourceManagerIdentifier does not match the content of the specified recovery information in recoveryInformation.
Comentários
Importante
Chamar este método quando você tiver dados não confiáveis é um risco à segurança.Calling this method with untrusted data is a security risk. Chame esse método apenas quando você tiver dados confiáveis.Call this method only with trusted data. Para obter mais informações, confira Validação de dados.For more information, see Data Validation.
Um Gerenciador de recursos facilita a resolução de inscrições duráveis em uma transação, reenlisting o participante de transação após falha de recurso.A resource manager facilitates resolution of durable enlistments in a transaction by reenlisting the transaction participant after resource failure.
O resourceManagerIdentifier parâmetro é usado para rotular consistentemente o participante de uma transação no caso de uma falha de recurso.The resourceManagerIdentifier parameter is used to consistently label the participant of a transaction in the event of a resource failure. Ao chamar o Reenlist método, o Gerenciador de recursos deve fornecer o mesmo resourceManagerIdentifier usado quando ele originalmente chamou o EnlistDurable método durante a inscrição ou um TransactionException é gerado.When calling the Reenlist method, the resource manager must provide the same resourceManagerIdentifier as it used when it originally called the EnlistDurable method during enlistment, or a TransactionException is thrown.
Quando um participante é reenlisted usando esse método, os métodos de fase 2 da IEnlistmentNotification que correspondam ao resultado da transação (isto é, Commit , Rollback ou InDoubt ) são chamados conforme apropriado.When a participant is reenlisted using this method, the phase 2 methods of IEnlistmentNotification that correspond to the transaction's outcome (that is, Commit , Rollback or InDoubt ) are called as appropriate.
Depois que os participantes tiverem sido reinscritos com êxito, você deverá chamar RecoveryComplete para concluir a recuperação.After the participants are successfully reenlisted, you should then call RecoveryComplete to complete the recovery.
Você só deve chamar esse método quando um Gerenciador de recursos for reiniciado a partir de uma falha.You should only call this method when a resource manager restarts from failure. Além disso, você só deve reinscrevê registradas por um Gerenciador de recursos durante a fase de preparação inicial de protocolo 2PC de transações não resolvidas.In addition, you should only reenlist unresolved transactions logged by a resource manager during the initial Prepare phase of a two-phase commit. Qualquer tentativa de chamar esse método em momentos inválidos pode produzir resultados incorretos.Any attempt to call this method at invalid times can produce erroneous results.
Se o Gerenciador de transações falhar e o Gerenciador de recursos executar a recuperação apenas um pouco tempo depois de você ter chamado o Prepared método em uma inscrição na fase 1 do protocolo de confirmação de Two-Phase, o Gerenciador de recursos poderá receber o InDoubt Rollback retorno de chamada ou.If the transaction manager fails, and your resource manager performs recovery only a short time after you called the Prepared method on an enlistment in phase 1 of the Two-Phase Commit protocol, your resource manager might either receive the InDoubt or Rollback callback.
Para obter mais informações sobre recuperação, consulte executando a recuperação.For more information on recovery, see Performing Recovery.
Observação Esse método usa LinkDemand para impedir que ele seja chamado de código não confiável; no entanto, somente o chamador imediato precisa ter o FullTrust conjunto de permissões.Note This method uses LinkDemand to prevent it from being called from untrusted code; however, only the immediate caller is required to possess the FullTrust permission set.