<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _nested_transactional(fn):
 # type: (Callable) -> Callable """In a transactional method create a nested transaction."""

    @wraps(fn)
    def wrapped(self, *args, **kwargs):
        # type: (SessionFactory) -> Any

        try:
            rv = fn(self, *args, **kwargs)
        except _TransactionalPolicyViolationError as e:
            getattr(self, _TX_HOLDER_ATTRIBUTE).rollback()
            rv = e.result

        return rv
    return wrapped