ObjectDB ObjectDB

Internal Website Search

31-40 of 200 resultsRefresh

Obtaining a JPA Database Connection

, 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

Storing JPA Entity Objects

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

Database Connection using JPA

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

Step 3: Define a Spring DAO Component

.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

Step 3: Define a Spring DAO Component

.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


Static Field javax.jdo.Constants String PROPERTY_TRANSACTION_ISOLATION_LEVEL_READ_COMMITTED "javax.jdo.option.TransactionIsolationLevel.read-committed" Since: JDO 2.2 See Also: PersistenceManagerFactory.supportedOptions()


Static Field javax.jdo.Constants String PROPERTY_TRANSACTION_ISOLATION_LEVEL "javax.jdo.option.TransactionIsolationLevel" Since: JDO 2.2


Method javax.jdo.Transaction boolean getRetainValues() If true, at commit time instances retain their field values. Returns: the value of the retainValues property Since: JDO 1.0


Method javax.jdo.Transaction boolean getRestoreValues() Return the current value of the restoreValues property. Returns: the value of the restoreValues property Since: JDO 1.0


Method javax.jdo.Transaction void setRetainValues( boolean retainValues ) If true, at commit instances retain their values and the instances transition to persistent-nontransactional. If an implementation does not support this option, a JDOUnsupportedOptionException is thrown. Parameters

Getting Started

ObjectDB is very easy to use. Follow the Getting Started Tutorial and the Quick Tour manual chapter and in minutes you may be able to write and run first Java programs against ObjectDB.

Prior knowledge or experience in database programming (SQL, JDBC, ORM, JPA, etc.) is not required, but some background in using the Java language is essential.

Need Help?

  1. Search ObjectDB website
  2. Read the FAQ
  3. Follow the Tutorials
  4. View or post in the forum
  5. Search or file an issue
  6. Contact support