ObjectDB Database Search

1-31 of 31 results

Database Connection using JPA

the content of a database require active transactions. Transactions are managed by an EntityTransaction ... (properties); EntityTransaction Operations that affect the content of the database (store, update, delete) must be performed within an active transaction. The EntityTransaction interface represents and manages

Obtaining a JPA Database Connection

content also require an EntityTransaction instance. Obtaining an EntityManagerFactory Obtaining ... an EntityTransaction Operations that modify database content, such as store, update, and delete ... an EntityManager instance and its associated EntityTransaction instances that the getTransaction method

InterfaceRef jakarta.persistence.EntityTransaction

JPA Interface EntityTransaction Interface used to control transactions on resource-local entity managers. The EntityManager.getTransaction method returns the EntityTransaction interface. Since: JPA 1.0 The Database Connection using JPA article explains how to use EntityTransaction . Public Methods

EntityTransaction.commit() does not release a pessimistic lock

It appears that EntityTransaction .commit() does not release a pessimistic lock - test code below. I tried it in with the current (2.7.6_01) and older versions (2.6.9, 2.5.7, 2.4.7) with the same result. (side note: EntityTransaction .rollback() releases it correctly) // Account.java package icke

EntityTransaction.rollback() - JPA Method

JPA Method in jakarta.persistence. EntityTransaction void rollback () Roll back the current resource transaction. Throws: IllegalStateException - if {@link #isActive()} is false PersistenceException - if an unexpected error condition is encountered Since: JPA 1.0

EntityTransaction.commit() - JPA Method

JPA Method in jakarta.persistence. EntityTransaction void commit () Commit the current resource transaction, writing any unflushed changes to the database. Throws: IllegalStateException - if {@link #isActive()} is false RollbackException - if the commit fails Since: JPA 1.0

EntityTransaction.begin() - JPA Method

JPA Method in jakarta.persistence. EntityTransaction void begin () Start a resource transaction. Throws: IllegalStateException - if {@link #isActive()} is true Since: JPA 1.0

EntityTransaction.setTimeout(timeout) - JPA Method

JPA Method in jakarta.persistence. EntityTransaction void setTimeout (   Integer timeout ) Set the transaction timeout, in seconds. This is a hint. Parameters: timeout - the timeout, in seconds, or null to indicate that the database server should set the timeout Since: JPA 3.2

EntityTransaction.getTimeout() - JPA Method

JPA Method in jakarta.persistence. EntityTransaction Integer getTimeout () The transaction timeout. Since: JPA 3.2

EntityTransaction.getRollbackOnly() - JPA Method

JPA Method in jakarta.persistence. EntityTransaction boolean getRollbackOnly () Determine whether the current resource transaction has been marked for rollback. Return: boolean indicating whether the transaction has been marked for rollback Throws: IllegalStateException - if {@link #isActive()} is false Since: JPA 1.0

EntityTransaction.setRollbackOnly() - JPA Method

JPA Method in jakarta.persistence. EntityTransaction void setRollbackOnly () Mark the current resource 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 Since: JPA 1.0

EntityTransaction.isActive() - JPA Method

JPA Method in jakarta.persistence. EntityTransaction boolean isActive () Indicate whether a resource transaction is in progress. Return: boolean indicating whether transaction is in progress Throws: PersistenceException - if an unexpected error condition is encountered Since: JPA 1.0

InterfaceRef jakarta.persistence.EntityManager

, transactions must be managed using the EntityTransaction obtained by calling () . A complete idiom for custom application management of the EntityManager and its associated resource-local EntityTransaction ... (); EntityTransaction transaction = entityManager.getTransaction(); try { transaction.begin(); // do work

EntityManager.getTransaction() - JPA Method

JPA Method in jakarta.persistence.EntityManager EntityTransaction getTransaction () Return the resource-level EntityTransaction object. The EntityTransaction instance may be used serially to begin and commit multiple transactions. Return: EntityTransaction instance Throws: IllegalStateException - if invoked on a JTA entity manager Since: JPA 1.0

Bug: ClassCastException by retrieval

; import javax.persistence.EntityManagerFactory; import javax.persistence. EntityTransaction ; import javax ... .createEntityManager();   EntityTransaction trans = em.getTransaction();   //* block-1

Unexpected NoSuchFieldError exception

.persistence. EntityTransaction $begin.call(Unknown Source) at app.database.ObjectDbDatabase.transact ... ) at javax.persistence. EntityTransaction $begin.call(Unknown Source) at app.database.ObjectDbDatabase

JBOSS AS7 7.1.1 - Entity not persisted and createNamedQuery fire exception

methodName ) {   javax.persistence. EntityTransaction et = em.getTransaction();   if ( et.isActive ... . EntityTransaction et = em.getTransaction();   javax.persistence.metamodel.ManagedType type = em.getMetamodel

Mysterious "Attempt to persist a reference to a non managed instance" error

.EntityManagerFactory; import javax.persistence. EntityTransaction ; import javax.persistence.Persistence; import com ... ;   EntityTransaction tx = em.getTransaction();       tx.begin();  

EnumRef jakarta.persistence.LockModeType

the PessimisticLockException and ensure that the JTA transaction or EntityTransaction has been marked

InterfaceRef jakarta.persistence.EntityManagerFactory

programmatically via the EntityTransaction interface. An EntityManagerFactory with a lifecycle managed by

ClassRef jakarta.persistence.RollbackException

. See Also: EntityTransaction .commit () Since: JPA 1.0 Public Constructors RollbackException () Constructs a new

EnumRef jakarta.persistence.PersistenceUnitTransactionType

is performed via the EntityTransaction interface. Since: JPA 3.2 Enum Constants JTA Transaction management

zip file or JAR manifest missing

PageTest { protected static EntityTransaction trans = SingleManager.getTrans(); protected static

failure to enforce NOT NULL for java.lang.String

.createEntityManager(); EntityTransaction tr = em.getTransaction(); Request r = new Request(); r.setUsername(null

"Attempt to lock a non entity object" error

() on a JPA EntityTransaction and I'm still getting the same error. Am I missing

How to delete M2M relationship?

(EntityManager em, Timeslot ts) { EntityTransaction transaction = em.getTransaction(); try { ArrayList

Cascading merge() leading to "Attempt to persist a reference to a non managed instance" error

; EntityTransaction tx = em.getTransaction();     tx.begin();     em.merge(new

Method Invocation On All Entities

(); EntityTransaction trans = em.getTransaction(); trans.begin(); em.createQuery("DELETE FROM MyEntity

Query results are not up to date for entities, not primitives

("PersistenceUnit"); EntityManager em2 = emf   .createEntityManager(); EntityTransaction tr = em2  

Error 363 - Failed to read value of inverse relationship

static boolean save(Object obj) {         EntityTransaction tr

objectdb-2.6.9_06: Extended Persistence Context fails: 'Attempt to begin a new transaction when a transaction is active'

"); } else { EntityTransaction t = em.getTransaction(); log_info($i, "em.transaction.isActive", t.isActive()); } } reset ... ) { log_warn($i, "AFTER: transaction is null!"); } else { EntityTransaction t = em.getTransaction(); log