/// <summary>
        /// Executes the given action with the command retry policy on the given <see cref="ReliableSqlDbConnection"/>.
        /// </summary>
        /// <param name="connection">The reliable connection</param>
        /// <param name="action">The action to execute</param>
        public static void ExecuteWithRetry(ReliableSqlDbConnection connection, System.Action action)
        {
            connection.ReliableConnection.CommandRetryPolicy.ExecuteAction(() =>
                {
                    if (connection.State != ConnectionState.Open)
                        connection.Open();

                    action();
                }
            );
        }
Beispiel #2
0
        /// <summary>
        /// Executes the given action with the command retry policy on the given <see cref="ReliableSqlDbConnection"/>.
        /// </summary>
        /// <param name="connection">The reliable connection</param>
        /// <param name="action">The action to execute</param>
        public static void ExecuteWithRetry(ReliableSqlDbConnection connection, System.Action action)
        {
            connection.ReliableConnection.CommandRetryPolicy.ExecuteAction(() =>
            {
                if (connection.State != ConnectionState.Open)
                {
                    connection.Open();
                }

                action();
            }
                                                                           );
        }
Beispiel #3
0
 /// <summary>
 /// Constructs a <see cref="ReliableAdoTransaction"/>.
 /// </summary>
 /// <param name="session">NHibernate session to use.</param>
 public ReliableAdoTransaction(ISessionImplementor session) : base(session)
 {
     _connection = (ReliableSqlDbConnection)session.Connection;
 }
 /// <summary>
 /// Constructs a <see cref="ReliableAdoTransaction"/>.
 /// </summary>
 /// <param name="session">NHibernate session to use.</param>
 public ReliableAdoTransaction(ISessionImplementor session) : base(session)
 {
     _connection = (ReliableSqlDbConnection) session.Connection;
 }