ObjectDB Database Search

1-50 of 200 results

Attempt to begin a new transaction when a transaction is active

(); emf.close(); } public void storeRecord(Record r) { em.getTransaction(). begin (); em.persist(r); em ... ._PersistenceException: Attempt to begin a new transaction when a transaction is active root cause com.objectdb.o._PersistenceException: Attempt to begin a new transaction when a transaction is active root cause

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

Storing JPA Entity Objects

", "Joseph", "Wurzelbacher"); em. getTransaction (). begin (); em. persist (employee); em. getTransaction ... (address); em. getTransaction (). begin (); em. persist (employee); em. getTransaction (). commit ... transactions: em. getTransaction (). begin (); for (int i = 1; i

Setting and Tuning of JPA Queries

anything outside that window). The setFirstResult method is used to specify where the result window begins , i.e. how many results at the beginning of the complete result list should be skipped and ignored

Obtaining a JPA Database Connection

to begin a transaction: em. getTransaction (). begin (); There is a one to one relationship between

Database Connection using JPA

that is available via the getTransaction method: try { em. getTransaction (). begin (); // Operations ... a call to begin and ended by a call to either commit or rollback . All the operations on the database

Updating JPA Entity Objects

. getTransaction (). begin (); employee.setNickname("Joe the Plumber"); em. getTransaction (). commit ... . getTransaction (). begin (); employee.projects[0] = new Project(); // not detected automatically

CRUD Database Operations with JPA

Given an EntityManager , em , that represents a JPA connection to the object database, we can use it to store, retrieve, update and delete database objects. Storing New Entity Objects The following code fragment stores 1,000 Point  objects in the database: em. getTransaction (). begin

Deleting JPA Entity Objects

); em. getTransaction (). begin (); em. remove (employee); em. getTransaction (). commit (); The entity

Posting Sample Code

.getTransaction(). begin ();         MyEntity e = new MyEntity("test

Database Explorer

Changes , the Explorer automatically begins a new transaction for the next editing session. Options

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

) Warning: javax.ejb.EJBException: com.objectdb.o._PersistenceException: Attempt to begin a new ... get that error: Caused by: com.objectdb.o.UserException: Attempt to begin a new transaction ... on next call to buildProject(String projectName) //'com.objectdb.o.UserException: Attempt to begin a new

EntityManager.refresh takes a long time

; logger.log(Level.INFO, " begin select for person " + new Date().toString());     ... (Level.INFO, " begin refresh for person = " +            ... + "  "+ new Date().toString());     }   INFO: begin select for person

Unexpected NoSuchFieldError exception

; [ObjectDB 2.6.9_09] javax.persistence.PersistenceException Attempt to begin a new transaction when a transaction is active (error 612) at com.objectdb.jpa.EMImpl. begin (EMImpl.java:275) at javax.persistence.EntityTransaction$ begin .call(Unknown Source) at app.database.ObjectDbDatabase.transact

evictAll() behavior

(); pm.currentTransaction(). begin (); System.out.println("Cache size after commit= " + pm ... ) and there is a result OBJECTDB OUTPUT: main--testDbProvisioning Cache size before COMMIT/ BEGIN = 1 transient transient Cache size after COMMIT/ BEGIN = 2630 transient transient Cache size after pm.evict = 2630  

How to Use a SF with extended Persistence Context?

to the SF I get com.objectdb.o._PersistenceException: Attempt to begin a new transaction when a transaction is active. In principal The SF doesn't need to begin any transaction since it only get called ... ._PersistenceException: Attempt to begin a new transaction when a transaction is active at com

Merge Issue: Attempt to reuse an existing primary key value

().isActive()) {             em.getTransaction(). begin ... ;       em.getTransaction(). begin ();       ... = emf.createEntityManager();         em.getTransaction(). begin

Is it possible to remove parent/child entities without refresh?

(). begin ();   entityManager.persist(parentEntity);   parentEntity.addChild(new ChildEntity ... = entityManager.find(ParentEntity.class, Long.valueOf(1));   entityManager.getTransaction(). begin ... .refresh(parentEntity);   entityManager.getTransaction(). begin ();   ChildEntity childEntity2

Remove an entity which attributes were changed - OptimisticLockException

.createEntityManager();         em.getTransaction(). begin ();   ... ;   em.getTransaction(). begin ();         MyEntity e = em ... ;    em.getTransaction(). begin ();         MyEntity

Selective merge/cascade of detatched entity

(). begin (); Company company = new Company("new"); em.persist(company); em.getTransaction().commit ... this? It might look something like: EntityManager em = emf.getEntityManager(); em.getTransaction(). begin ... .getTransaction. begin (); for (Salesman s : salesmen) em.uncheckedMerge(s); giveSalesmenNewTargets(salesmen

Optimistic locking: prevent version increment on entity collection attribute

.getTransaction(). begin ();        Document doc = new Document();    ... (). begin (); Document doc = new Document(); // Note that these readings will be added to the // document ... .getTransaction(). begin (); Document doc = new Document(); // Note that these readings will be added

Date field Index is corrupted due to time change

= emf.createEntityManager();         em.getTransaction(). begin ... ;   em.getTransaction(). begin ();         Long r = (Long ... ;   em.getTransaction(). begin ();           

Schema Update: class hierarchy change

em = emf.createEntityManager();   // Persist an entity   em.getTransaction(). begin ... ;   em.getTransaction(). begin ();   MyEntity entityWithID1 = em.find(MyEntity.class, 1 ... //  em.getTransaction(). begin (); //  MyEntity entity = new MyEntity(); //  entity.id = "123

Updating Entities

- All have been verified to be passed   Main.paygradeDB.getTransaction(). begin ();   this.rate = rate ... .getResultList().forEach(p - System.out.println(p.getRate())); Main.paygradeDB.getTransaction(). begin ... .employeeDB.getTransaction(). begin (); for(Employee e : Query.employeesByPaygrade(p)) //Returns

Persist error @ManyToMany how to define correct entities relationships

checkActive(){ if(!em.getTransaction().isActive()) em.getTransaction(). begin (); } } }     ... .getTransaction(). begin (); } } } lo Hoel I finally managed to get it working by using merge when commit fails ... (); emf.close(); } void checkActive(){ if(!em.getTransaction().isActive()) em.getTransaction(). begin

pessimistic lock not released on commit

.createEntityManager(); em.getTransaction(). begin (); if (em.find(MyEntity.class, 1L) == null) { em ... threadA() { EntityManager em = emf.createEntityManager(); try { em.getTransaction(). begin ... .getTransaction(). begin (); System.out.println("Thread B: trying to lock..."); MyEntity e = em.find(MyEntity

Remove a modified entity cause an optimistic lock exception

.createEntityManager();         em.getTransaction(). begin ();   ... ;   em.getTransaction(). begin ();         MyEntity e = em ... (FlushModeType.AUTO);         em.getTransaction(). begin ();    

Items in list are doubled, when the entity class is not enhanced

.getTransaction(). begin (); for(Object o : l){ em.remove(o); } em.getTransaction().commit(); l = em.createQuery("select i from Item i").getResultList(); em.getTransaction(). begin (); for(Object o : l){ em.remove(o); } em.getTransaction().commit(); em.getTransaction(). begin (); Customer c = new Customer

@OneToMany(fetch = FetchType.LAZY) list is always null

EntityManager entityManager; public void persist(Object o) { try { transaction. begin ... .printStackTrace(); } } public void persistChild(Child child) { try { transaction. begin ... { transaction. begin (); entityManager.persist(o); transaction.commit(); } catch (Exception e) { e

Step 4: Add a Servlet Class

.getTransaction(). begin (); em.persist(new Guest(name)); em.getTransaction().commit(); } // Display the list

Step 3: Define an EJB Session Bean

transaction  begin and  commit . The next step is adding a Servlet Class that will serve as the application controller.

Step 3: Define a Spring DAO Component

transaction begin and commit . The next step is adding a Controller Class .  

Step 3: Add a Main Class

= emf.createEntityManager(); // Store 1000 Point objects in the database: em.getTransaction(). begin (); for (int i = 0; i

Step 3: Add a Main Class

.createEntityManager(); // Store 1000 Point objects in the database: em.getTransaction(). begin (); for (int i = 0; i

Step 3: Define a Spring DAO Component

transaction begin and commit . The next step is adding a Controller Class .  

Step 3: Define an EJB Session Bean

begin and commit . The next step is adding a Servlet Class that will serve as the application controller.

Step 4: Add a Servlet Class

.getParameter("name"); if (name != null) { em.getTransaction(). begin (); em.persist(new Guest(name)); em

zip file or JAR manifest missing

because persistence unit is not essential. trans. begin ();    ItemList i = new ItemList();    i.setItemname(" Beginning ");    em.persist(i);    trans.commit(); gzdillon Lai ... ; while (--iCnt=0){    trans. begin ();    Page uri = new Page();    uri

New to Product & Having An Issue

.getTransaction(). begin (); em.persist(department); em.getTransaction().commit(); }catch(Exception e){ e ... { em.getTransaction(). begin (); em.remove(this.foundResult); em.getTransaction().commit(); }catch ... departments; try{ do{ departments = q.getResultList(); em.getTransaction(). begin (); for(Department d

Optimistic Locking

.currentTransaction(). begin (); pm.makePersistent(new Counter()); pm.currentTransaction().commit(); pm.close ... .getPersistenceManager(); Counter c1 = pm1.getExtent(Counter.class).iterator().next(); pm1.currentTransaction(). begin ... .currentTransaction(). begin (); c2.increase(); // First user commits - succeeds:   pm1.currentTransaction

InterfaceRef jakarta.persistence.EntityManager

(); EntityTransaction transaction = entityManager.getTransaction(); try { transaction. begin (); // do work ... object. The EntityTransaction instance may be used serially to begin and commit multiple transactions

InterfaceRef jakarta.persistence.EntityTransaction

void begin () Start a resource transaction. Throws: IllegalStateException - if {@link #isActive

EnumConstRef jakarta.persistence.criteria.Nulls.FIRST

JPA Enum Constant in jakarta.persistence.criteria.Nulls FIRST Null values occur at the beginning of the result set. Since: JPA 3.2

EnumRef jakarta.persistence.criteria.Nulls

JPA Enum Nulls java.lang.Object ∟  java.lang.Enum ∟  jakarta.persistence.criteria.Nulls Specifies the precedence of null values within query result sets. See Also: CriteriaBuilder.asc CriteriaBuilder.desc Since: JPA 3.2 Enum Constants FIRST Null values occur at the beginning

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

Tracking changes to new collections (in enhancement mode) after flush

;                em.getTransaction(). begin ... .createEntityManager(); em.setFlushMode(FlushModeType.AUTO); em.getTransaction(). begin (); ModelElementImpl ... .createEntityManager(); em.setFlushMode(FlushModeType.AUTO); em.getTransaction(). begin

Unexpected exception (Error 990) com.objectdb.o.InternalException

.getTransaction(). begin ();         em.persist(new MyEntity());   ... ; em.getTransaction(). begin ();         embeddable.update();   ... with an embeddable:         em.getTransaction(). begin ();    

Remove of an entry from a @OneToMany collection is not possible if the enhancer is disabled

ParentEntity();   entityManager.getTransaction(). begin ();   entityManager.persist(parentEntity);   entityManager.getTransaction().commit();   entityManager.getTransaction(). begin ... .getTransaction(). begin ();         MyEntity e = new MyEntity

New entity objects are duplicated on merge cascading

= emf.createEntityManager();         em.getTransaction(). begin ... ;   em.getTransaction(). begin ();         book.chapters ... .createEntityManager();         em.getTransaction(). begin ();   

[ObjectDB 2.2.6_02] Unexpected exception (Error 990) at com.objectdb.o.OBC.aJ(OBC.java:961)

{ EntityManager em = null; try { em = getEntityManager(); em.getTransaction(). begin (); em.persist(moment); em ... Exception { EntityManager em = null; try { em = getEntityManager(); em.getTransaction(). begin (); em ... Exception { EntityManager em = null; try { em = getEntityManager(); em.getTransaction(). begin (); chart