<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def atomic(connection_name: Optional[str] = None) -> Callable: """ Transaction decorator. You can wrap your function with this decorator to run it into one transaction. If error occurs transaction will rollback. :param connection_name: name of connection to run with, optional if you have only one db connection """


    def wrapper(func):
        @wraps(func)
        async def wrapped(*args, **kwargs):
            connection = _get_connection(connection_name)
            async with connection._in_transaction():
                return await func(*args, **kwargs)

        return wrapped

    return wrapper