 202 | contains two types of files: Backup files - with names of the form <transaction-id>.odb Recording files - with names of the form <transaction-id>.odr A backup file is an ordinary ObjectDB database file that reflects the state of the database at the end of a specific transaction. The ID |
 91 | , update, and delete should only be performed within an active transaction. Given an EntityManager, em, it is very easy to begin a transaction:
em.getTransaction().begin ... that the getTransaction method returns. When a transaction is active you can invoke EntityManager methods |
 80 | and changes its state to Managed. The new entity object is stored in the database when the transaction ... field values). A TransactionRequiredException is thrown if there is no active transaction when persist is called because operations that modify the database require an active transaction. If the database |
 80 | the content of a database require active transactions. Transactions are managed by an EntityTransaction ... ) must be performed within an active transaction. The EntityTransaction interface represents and manages database transactions. Every EntityManager holds a single attached EntityTransaction instance |
 75 | javax.jdo Interface Transaction The JDO Transaction interface provides for initiation and completion of transactions under user control. It is a sub-interface of the PersistenceManager that deals with options and transaction demarcation. Transaction options include whether optimistic concurrency |
 73 | .transaction.annotation.Transactional;
@Component
public class GuestDao {
// Injected database ... :
@Transactional
public void persist(Guest guest) {
em.persist(guest ... field (because it is annotated with the @PersistenceContext annotation). Handles transactions |
 73 | .TypedQuery;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
@Component
public class GuestDao {
// Injected database connection:
@PersistenceContext private EntityManager em;
// Stores a new guest:
@Transactional |
 68 | from inside an active transaction:
Employee employee = em.find(Employee.class, 1);
em ... ();
The entity object is physically updated in the database when the transaction is committed. If the transaction is rolled back and not committed the update is discarded. On commit the persist operation |
 56 | Method javax.jdo.Transaction void setIsolationLevel( String level ) Set the value for transaction isolation level for this transaction. Transaction isolation levels are defined in javax.jdo ... - the transaction isolation level Since: JDO 2.2 See Also: getIsolationLevel() Constants.TX_READ |
 56 | Method javax.jdo.Transaction void begin() Begin a transaction. The type of transaction is determined by the setting of the Optimistic flag. Throws: JDOUserException - if transactions are managed by a container in the managed environment, or if the transaction is already active. Since: JDO 1.0 See Also: setOptimistic getOptimistic |