openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bardolf <bard...@seznam.cz>
Subject JPA update entities every (even empty) commit
Date Sat, 22 Mar 2008 01:36:59 GMT
Hi all,
I have following question. Why JPA call updates on all changed entities 
during commit even though persist wasn't called.

[snip]
EntityManager em = 
javax.persistence.Persistence.createEntityManagerFactory("JavaApplication3PU").createEntityManager();
Address ad = em.find(Address.class,1);
ad.setMyProperty(xxx);
em.getTransaction().begin();
em.getTransaction().commit();
[/snip]

And even though I didn't call persist, changes are updated in database. 
WHY???

Thanks B.


Mime
View raw message