ObjectDB Database Search

1-50 of 200 results

jakarta.persistence.EntityTransaction.begin()

Jakarta Persistence (JPA) Method in jakarta.persistence.EntityTransaction void begin () Start a resource transaction. Throws: IllegalStateException - if EntityTransaction.isActive is true. Since: Jakarta Persistence (JPA) 1.0

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

Storing JPA Entities

("Samuel", "Joseph", "Wurzelbacher"); em. getTransaction (). begin (); em. persist (employee); em ... . getTransaction (). begin (); em. persist (employee); em. getTransaction (). commit (); Instances ... the clear and flush methods together to save memory during large transactions: em. getTransaction (). begin (); for (int i = 1; i

Obtaining a JPA Database Connection

within an active transaction. Given an EntityManager instance named em , you can begin a transaction: em. getTransaction (). begin (); A one-to-one relationship exists between an EntityManager instance

JPA Connections and Transactions

{ em. getTransaction (). begin (); // Operations that modify the database should come here. em ... (). rollback (); } A transaction is started by calling begin and completed by calling either commit or

Updating JPA Entities

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

Setting and Tuning of JPA Queries

the beginning of the complete result list. The setMaxResults method specifies the size of the result

JPA Core Types

environments that do not use JTA. Use this interface to explicitly begin , commit , or roll

CRUD Database Operations with JPA

Given an EntityManager instance, em , which manages the persistence context for the database, you can use it to store, retrieve, update, and delete objects. Storing new entities The following code fragment stores 1,000 Point objects in the database: em. getTransaction (). begin (); for (int i = 0

Deleting JPA Entities

: Employee employee = em. find (Employee.class, 1); em. getTransaction (). begin (); em. remove (employee

Posting Sample Code

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

Online Backup

. It returns immediately after the backup begins , but the operation might still be in progress. The backup

Database Explorer

File Save or File Discard Changes , the Explorer automatically begins a new transaction

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

jakarta.persistence.EntityManager

= entityManager.getTransaction(); try { transaction. begin (); // do work ... transaction.commit(); } catch ... serially to begin and commit multiple transactions. Returns: EntityTransaction instance. Throws

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  

jakarta.persistence.EntityTransaction

JPA article explains how to use EntityTransaction . Public Instance Methods void begin () Start

jakarta.persistence.criteria.Nulls

Constants FIRST Null values occur at the beginning of the result set. Since: Jakarta Persistence (JPA

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

jakarta.persistence.EntityManager.getTransaction()

Jakarta Persistence (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. Returns: EntityTransaction instance. Throws

jakarta.persistence.criteria.Nulls.FIRST

Jakarta Persistence (JPA) Enum Constant in jakarta.persistence.criteria.Nulls FIRST Null values occur at the beginning of the result set. Since: Jakarta Persistence (JPA) 1.0

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

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

the need to wrap every operation that modifies the database (such as persist ) by transaction begin

Step 3: Define an EJB Session Bean

- no need to wrap every operation that modifies the database (such as persist ) by transaction begin

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

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