Just on a hunch, Try em.clear() between the first commit and the find, I had a strange issue like this before:
em.getTransaction().commit(); em.clear(); Person fx = em.find(Person.class, 1); -----Original Message----- From: davidautentico [mailto:[email protected]] Sent: Tuesday, 1 June 2010 1:10 AM To: [email protected] Subject: RE: tomcat6+openjpa+jsf Same error with this code: emf = Persistence.createEntityManagerFactory("person",System.getProperties()); EntityManager em = emf.createEntityManager(); em.getTransaction().begin(); Person p1 = new Person(); p1.setIdPerson(1); p1.setMail("mail1"); p1.setName("p1"); em.persist(p1); em.getTransaction().commit(); Person fx = em.find(Person.class, 1); em.getTransaction().begin(); if (fx!=null){ fx.setMail("ea"); em.merge(p1); } em.getTransaction().commit(); em.close(); -- View this message in context: http://openjpa.208410.n2.nabble.com/tomcat6-openjpa-jsf-tp5120836p5122147.ht ml Sent from the OpenJPA Users mailing list archive at Nabble.com.
