The rollback() method is used to roll back the transaction associated with the current thread. This method belongs to the UserTransaction interface. The current thread becomes associated with no transaction when this method completes. The general form of this method is as follows:
public abstract void rollback() throws IllegalStateException, SecurityException
This method throws a SecurityException if the current thread is not allowed to roll back the transaction. It throws an IllegalStateException if the current thread is not associated with a transaction.