>From your sample you have two issues, 1) you should be merging, 2) I don't'
see a commit anywhere after the missing merge, here is a very basic sample
of how to do it :
EntityManagerFactory emf =
Persistence.createEntityManagerFactory("PERSISTENCEUNITNAME");
EntityManager em = emf.createEntityManager();
em.getTransaction().begin();
Person p1 = new Person();
p1.setIdPerson(1);
p1.setMail("mail1");
p1.setName("p1");
kem.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.commit();
-----Original Message-----
From: davidautentico [mailto:[email protected]]
Sent: Monday, 31 May 2010 8:40 PM
To: [email protected]
Subject: RE: tomcat6+openjpa+jsf
The most interesting thing is that if I run the same code outside a
TOMCAT+JSF enviroment (as a java application in Eclipse) it works perfectly.
I think it is an JSF/TOMCAT issue, object refresh or something like this.
Any ideas?
--
View this message in context:
http://openjpa.208410.n2.nabble.com/tomcat6-openjpa-jsf-tp5120836p5121295.ht
ml
Sent from the OpenJPA Users mailing list archive at Nabble.com.