Este conteúdo não está disponível no idioma selecionado.
11.7.6. Roll Back a Transaction
You must begin a transaction before you can roll it back. For information on how to begin a transaction, refer to Section 11.7.3, “Begin a Transaction”.
Call the
rollback()
method on theUserTransaction
.When you call therollback()
method on theUserTransaction
, the Transaction Manager attempts to roll back the transaction and return the data to its previous state.Copy to Clipboard Copied! Toggle word wrap Toggle overflow If you use Container Managed Transactions (CMT), you do not need to manually roll back the transaction.
If you configure your bean to use Container Managed Transactions, the container will manage the transaction lifecycle for you based on annotations you configure in the code.
Your transaction is rolled back by the Transaction Manager.
Note