/// <summary>
        /// Initializes a new instance of the <see cref="GlimpseAdomdTransaction"/> class.
        /// </summary>
        /// <param name="innerTransaction">The underlying IDbTransaction.</param>
        /// <param name="connection">The associated AdomdConnection.</param>
        /// <param name="connectionId">The connection identifier.</param>
        /// <param name="messagePublisher">The message publisher.</param>
        internal GlimpseAdomdTransaction(IDbTransaction innerTransaction, IDbConnection connection, Guid connectionId, ITimedMessagePublisher messagePublisher)
        {
            if (innerTransaction == null)
            {
                throw new ArgumentNullException("innerTransaction");
            }
            if (connection == null)
            {
                throw new ArgumentNullException("connection");
            }
            if (messagePublisher == null)
            {
                throw new ArgumentNullException("messagePublisher");
            }
            _innerTransaction = innerTransaction;
            _innerConnection = connection;
            _connectionId = connectionId;
            _messagePublisher = messagePublisher;

            TransactionId = Guid.NewGuid();
            
            _messagePublisher.EmitStartMessage(
                new TransactionBeganMessage(
                    _connectionId,
                    TransactionId,
                    _innerTransaction.IsolationLevel));
        }
Example #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GlimpseAdomdTransaction"/> class.
        /// </summary>
        /// <param name="innerTransaction">The underlying IDbTransaction.</param>
        /// <param name="connection">The associated AdomdConnection.</param>
        /// <param name="connectionId">The connection identifier.</param>
        /// <param name="messagePublisher">The message publisher.</param>
        internal GlimpseAdomdTransaction(IDbTransaction innerTransaction, IDbConnection connection, Guid connectionId, ITimedMessagePublisher messagePublisher)
        {
            if (innerTransaction == null)
            {
                throw new ArgumentNullException("innerTransaction");
            }
            if (connection == null)
            {
                throw new ArgumentNullException("connection");
            }
            if (messagePublisher == null)
            {
                throw new ArgumentNullException("messagePublisher");
            }
            _innerTransaction = innerTransaction;
            _innerConnection  = connection;
            _connectionId     = connectionId;
            _messagePublisher = messagePublisher;

            TransactionId = Guid.NewGuid();

            _messagePublisher.EmitStartMessage(
                new TransactionBeganMessage(
                    _connectionId,
                    TransactionId,
                    _innerTransaction.IsolationLevel));
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="CommandExecutor"/> class.
 /// </summary>
 /// <param name="command">The glimpse command.</param>
 /// <param name="messagePublisher">The message publisher.</param>
 public CommandExecutor(GlimpseAdomdCommand command, ITimedMessagePublisher messagePublisher)
 {
     if (command == null)
     {
         throw new ArgumentNullException("command");
     }
     if (messagePublisher == null)
     {
         throw new ArgumentNullException("messagePublisher");
     }
     _command          = command;
     _messagePublisher = messagePublisher;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="GlimpseAdomdConnection"/> class.
 /// </summary>
 /// <param name="connection">An already wrapped adomdconnection.</param>
 /// <param name="messagePublisher">The message publisher.</param>
 internal GlimpseAdomdConnection(IAdomdConnection connection, ITimedMessagePublisher messagePublisher)
 {
     if (connection == null)
     {
         throw new ArgumentNullException("connection");
     }
     if (messagePublisher == null)
     {
         throw new ArgumentNullException("messagePublisher");
     }
     _innerConnection  = connection;
     _messagePublisher = messagePublisher;
     _connectionId     = Guid.NewGuid();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="GlimpseAdomdConnection"/> class.
 /// </summary>
 /// <param name="connection">An already wrapped adomdconnection.</param>
 /// <param name="messagePublisher">The message publisher.</param>
 internal GlimpseAdomdConnection(IAdomdConnection connection, ITimedMessagePublisher messagePublisher)
 {
     if (connection == null)
     {
         throw new ArgumentNullException("connection");
     }
     if (messagePublisher == null)
     {
         throw new ArgumentNullException("messagePublisher");
     }
     _innerConnection = connection;
     _messagePublisher = messagePublisher;
     _connectionId = Guid.NewGuid();
 }