示例#1
0
        void IMessageModule.HandleEndMessage()
        {
            if (DocumentSessionFactory == null)
            {
                return;
            }

            DocumentSessionFactory.Current.SaveChanges();
            DocumentSessionFactory.Complete();
        }
示例#2
0
        void IMessageModule.HandleError()
        {
            if (DocumentSessionFactory == null)
            {
                return;
            }

            if (Transaction.Current != null)
            {
                var txId = Transaction.Current.TransactionInformation.DistributedIdentifier;
                DocumentSessionFactory.Current.Advanced.DatabaseCommands.Rollback(txId);
            }

            DocumentSessionFactory.Complete();
        }