RavenFS.Storage.TransactionalStorage.ExecuteBatch C# (CSharp) Method

ExecuteBatch() private method

private ExecuteBatch ( Action action ) : void
action Action
return void
		private void ExecuteBatch(Action<StorageActionsAccessor> 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;
			}
		}
	}