Esempio n. 1
0
        private void ExecuteBatch(Action <IStorageActionsAccessor> action)
        {
            var errorInUserAction = false;

            try
            {
                using (var storageActionsAccessor = new StorageActionsAccessor(tableColumnsCache, instance, database, uuidGenerator, fileCodecs))
                {
                    if (disableBatchNesting.Value == null)
                    {
                        current.Value = storageActionsAccessor;
                    }

                    errorInUserAction = true;
                    action(storageActionsAccessor);
                    errorInUserAction = false;
                    storageActionsAccessor.Commit();
                }
            }
            catch (Exception e)
            {
                if (errorInUserAction == false)
                {
                    log.ErrorException("Failed to execute transaction. Most likely something is really wrong here.", e);
                }

                throw;
            }
            finally
            {
                current.Value = null;
            }
        }
Esempio n. 2
0
        private void ExecuteBatch(Action <IStorageActionsAccessor> action)
        {
            try
            {
                using (var storageActionsAccessor = new StorageActionsAccessor(tableColumnsCache, instance, database, uuidGenerator, fileCodecs))
                {
                    if (disableBatchNesting.Value == null)
                    {
                        current.Value = storageActionsAccessor;
                    }

                    action(storageActionsAccessor);
                    storageActionsAccessor.Commit();
                }
            }
            finally
            {
                current.Value = null;
            }
        }
Esempio n. 3
0
        private void ExecuteBatch(Action <IStorageActionsAccessor> action)
        {
            if (current.Value != null)
            {
                action(current.Value);
                return;
            }

            try
            {
                using (var storageActionsAccessor = new StorageActionsAccessor(tableColumnsCache, instance, database))
                {
                    current.Value = storageActionsAccessor;

                    action(storageActionsAccessor);
                    storageActionsAccessor.Commit();
                }
            }
            finally
            {
                current.Value = null;
            }
        }
Esempio n. 4
0
        private void ExecuteBatch(Action<IStorageActionsAccessor> action)
        {
            try
            {
                using (var storageActionsAccessor = new StorageActionsAccessor(tableColumnsCache, instance, database, uuidGenerator, fileCodecs))
                {
                    if (disableBatchNesting.Value == null)
                        current.Value = storageActionsAccessor;

                    action(storageActionsAccessor);
                    storageActionsAccessor.Commit();
                }
            }
            finally
            {
                current.Value = null;
            }
        }
		private void ExecuteBatch(Action<IStorageActionsAccessor> action)
		{
			if (current.Value != null)
			{
				action(current.Value);
				return;
			}

			try
			{
				using (var storageActionsAccessor = new StorageActionsAccessor(tableColumnsCache, instance, database))
				{
					current.Value = storageActionsAccessor;

					action(storageActionsAccessor);
					storageActionsAccessor.Commit();
				}
			}
			finally
			{
				current.Value = null;
			}
		}