Esempio n. 1
0
 public override void Commit()
 {
     _storage.UseTransaction(connection =>
     {
         foreach (Action <MySqlConnection> command in _commandQueue)
         {
             command(connection);
         }
     });
 }
        public override void Commit()
        {
            _storage.UseTransaction(connection =>
            {
                connection.EnlistTransaction(Transaction.Current);

                foreach (var command in _commandQueue)
                {
                    command(connection);
                }
            });
        }
Esempio n. 3
0
        public override void Commit()
        {
            MySqlStorageConnection.AttemptActionReturnObject(() =>
            {
                _storage.UseTransaction(connection =>
                {
                    connection.EnlistTransaction(Transaction.Current);

                    foreach (var command in _commandQueue)
                    {
                        command(connection);
                    }
                });
                return(0);
            });
        }
Esempio n. 4
0
        public override void SetRangeInHash(string key, IEnumerable <KeyValuePair <string, string> > keyValuePairs)
        {
            if (key == null)
            {
                throw new ArgumentNullException("key");
            }
            if (keyValuePairs == null)
            {
                throw new ArgumentNullException("keyValuePairs");
            }

            _storage.UseTransaction(connection =>
            {
                foreach (var keyValuePair in keyValuePairs)
                {
                    connection.Execute(
                        "insert into HangfireHash (`Key`, Field, Value) " +
                        "value (@key, @field, @value) " +
                        "on duplicate key update Value = @value",
                        new { key = key, field = keyValuePair.Key, value = keyValuePair.Value });
                }
            });
        }