About EntityManager

181-190 of 200Refresh
Forum
1

Update more than 10000 entities by an update query fails

"); EntityManager emOne = emf.createEntityManager(); emOne.getTransaction().begin ... ); } emOne.getTransaction().commit(); emOne.close(); EntityManager ... (); emTwo.close(); EntityManager emThree = emf.createEntityManager(); emThree
Forum
1

Database is erased after deploying a new web application version

from Tomcat's manager? When should I use the close method of EntityManagerFactory and EntityManager ... of EntityManagerFactory and EntityManager? You can close the EntityManagerFactory when the web application is closed (see this example). Usually EntityManager instances are created and closed
Forum
1

"Attempt to lock a non entity object" error

once per EntityManager. I've downloaded the new build and tried the code above that uses a JDO Transaction ... .Entity; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory ... \\workspace\\TestProject\\Storage.odb");         EntityManager em = emf.createEntityManager
Forum
1

Criteria query error: Unexpected query token

= entityManager.getCriteriaBuilder(); CriteriaQuery c = qb.createQuery(aClass); c.from(aClass); return entityManager.createQuery(c).getResultList(); }   Entities ... ) {      CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();      CriteriaQuery q
Forum
1

Does ObjectDB support lazy loading?

. However, when the Parent object is read from EntityManager, all the properties except ID of the Child objects are null. The EntityManager is not yet closed when the getters are called. After I change the annotation ... = Persistence.createEntityManagerFactory(path); EntityManager em = emf.createEntityManager
Forum
1

Entity factory

, you can obtain the EntityManager in a JPA listener method by using JDO:     EntityManager em = // find the EntityManager that manages this             (EntityManager)JDOHelper
Forum
1

Entity has be persistended,but query not fetched?

.odb");         EntityManager em = emf.createEntityManager();         em.getTransaction().begin ... {} } Maybe you are using a different EntityManager for the query? Updates can only be visible before commit in the EntityManager that was used to apply the updates. Thanks! I are using a different EntityManager for the query. maozf
Forum
1

EntityManagerFactory Fails To Swtich Over To Slave When Master Is Unavailable

; public static void main(String[] args) {   EntityManagerFactory emf = null;   EntityManager em = null ... ();   } finally {    emf.close();   } } private static void queryDatabase(EntityManager em ... ) {   EntityManagerFactory emf = null;   EntityManager em = null;   try {    emf = Persistence
Forum
1

Field not persisted in abstract class with two level of nesting

.Entity; import javax.persistence.EntityManager; import javax.persistence.Persistence; @Entity ... main(String[] args){         EntityManager em = Persistence.createEntityManagerFactory("$objectdb/db ... .EntityManager; import javax.persistence.Persistence; @Entity public class MHD2 implements Serializable
Forum
1

find() delay

a transaction of em. Maybe different EntityManager instances are used and the L2 cache is enabled. L2 ... .createEntityManagerFactory(             "$objectdb/db/test.odb");         EntityManager em = emf.createEntityManager ... ");   EntityManager em = emf.createEntityManager();   EntityTransaction trans = em.getTransaction();   int