code: @Override
     public void rollback() throws IllegalStateException, SecurityException,
                                   SystemException {
        Transaction tx = getTransaction();
        if (tx == null)
           throw new IllegalStateException("no transaction associated with thread");
        tx.rollback();
  
        // Disassociate tx from thread.
        setTransaction(null);
     }
docs: Rolls back the transaction associated with the calling thread.
  
  @throws IllegalStateException If the transaction is in a state where it cannot be rolled back. This could be
  because the calling thread is not associated with a transaction, or because it is in
  the {@link javax.transaction.Status#STATUS_PREPARED prepared state}.
  @throws SecurityException     If the caller is not allowed to roll back this transaction.
  @throws javax.transaction.SystemException
  If the transaction service fails in an unexpected way.