FileDocCategorySizeDatePackage
EntityTransaction.javaAPI DocGlassfish v2 API3651Fri May 04 22:34:06 BST 2007javax.persistence

EntityTransaction

public interface EntityTransaction
The EntityTransaction interface is used to control resource transactions on resource-local entity managers. The {@link EntityManager#getTransaction EntityManager.getTransaction()} method returns the EntityTransaction interface.
since
Java Persistence 1.0

Fields Summary
Constructors Summary
Methods Summary
public voidbegin()
Start the resource transaction.

throws
IllegalStateException if {@link #isActive()} is true.

public voidcommit()
Commit the current transaction, writing any unflushed changes to the database.

throws
IllegalStateException if {@link #isActive()} is false.
throws
RollbackException if the commit fails.

public booleangetRollbackOnly()
Determine whether the current transaction has been marked for rollback.

throws
IllegalStateException if {@link #isActive()} is false.

public booleanisActive()
Indicate whether a transaction is in progress.

throws
PersistenceException if an unexpected error condition is encountered.

public voidrollback()
Roll back the current transaction

throws
IllegalStateException if {@link #isActive()} is false.
throws
PersistenceException if an unexpected error condition is encountered.

public voidsetRollbackOnly()
Mark the current transaction so that the only possible outcome of the transaction is for the transaction to be rolled back.

throws
IllegalStateException if {@link #isActive()} is false.