Home » Search

About begin

51-60 of 200Refresh
Forum
2

Remove an entity which attributes were changed - OptimisticLockException

");         EntityManager em = emf.createEntityManager();         em.getTransaction().begin ... ();         em = emf.createEntityManager();         em.getTransaction().begin();         MyEntity e = em ... = emf.createEntityManager();         em.getTransaction().begin();         MyEntity entity = new
Forum
2

Unable to execute update query

();                 em.getTransaction().begin();         for (int i = 0; i < 400000; i ... .getTransaction().begin();         Query query = em.createQuery("UPDATE MyEntity e SET e.x = 7 ... ("Adding objects");         em.getTransaction().begin();         for (int i = 0; i < 1000000; i
Forum
1

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

) { try { transaction.begin(); entityManager.persist(o ... { transaction.begin(); entityManager.persist(child); if (child ... .begin(); entityManager.persist(o); transaction.commit(); } catch
Forum
1

Date field Index is corrupted due to time change

().begin();                 // Add records         DateTime dt = null;         try {             dt ... ");         em.getTransaction().begin();         Long r = (Long) q.getSingleResult();         em ... {             q = em.createQuery("DELETE FROM DateTime");             em.getTransaction().begin();             q
Forum
1

Internal exception when updating date filed (TemporalType.DATE)

:" + newBirthday.toString());             try {                 entityManager.getTransaction().begin ... {                 entityManager.getTransaction().begin();                 for (int index = 0; index < count; index ... (); if (personsCount == 0) { entityManager.getTransaction().begin(); for (int index
Forum
1

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

.createQuery("select c from Customer c").getResultList(); em.getTransaction().begin ... = em.createQuery("select i from Item i").getResultList(); em.getTransaction().begin ... (); em.getTransaction().begin(); Customer c = new Customer(); em
Issue
1

New entity objects are duplicated on merge cascading

();         em.getTransaction().begin();         em.persist(new Book());         em.getTransaction().commit ... ();         em.getTransaction().begin();         book.chapters = Arrays.asList(new Chapter());         em.merge ... = emf.createEntityManager();         em.getTransaction().begin();         em.persist(new
Forum
1

Optimistic locking: prevent version increment on entity collection attribute

() {     // em is the EntityManager     em.getTransaction().begin();        Document doc = new ... (); em.getTransaction().begin(); Document doc = new Document ... (); em.getTransaction().begin(); Document doc = new Document(); // Note
Forum
1

Persist error @ManyToMany how to define correct entities relationships

(){ if(!em.getTransaction().isActive()) em.getTransaction().begin ... ().isActive()) em.getTransaction().begin(); } } } I finally managed ... ().begin(); } } } If you use merge, you many want to change the cascade setting
Forum
1

Remove a modified entity cause an optimistic lock exception

= emf.createEntityManager();         em.getTransaction().begin();         em.persist(new MyEntity ... .createEntityManager();         em.getTransaction().begin();         MyEntity e = em.find(MyEntity.class, 1 ... (FlushModeType.AUTO);         em.getTransaction().begin();         em.persist(new MyEntity