public XmsCommitPerScopeProducer(IXmsProducer producer, ISession session, Action onTransactionCompleted)
 {
     this.producer = producer;
     this.session = session;
     this.onTransactionCompleted = onTransactionCompleted;
     if (Transaction.Current == null)
     {
         throw new Exception("You cannot use XmsCommitPerScopeProducer when there is no transaction.");
     }
     log.Debug("Enlisting producer in global transaction scope.");
     Transaction.Current.EnlistVolatile(this, EnlistmentOptions.None);
     Transaction.Current.TransactionCompleted += OnTransactionCompleted;
 }
 public XmsCommitPerCallProducer(IXmsProducer producer, ISession session)
 {
     this.producer = producer;
     this.session = session;
 }