datacache does not get committed when application commit after a query
----------------------------------------------------------------------
Key: OPENJPA-265
URL: https://issues.apache.org/jira/browse/OPENJPA-265
Project: OpenJPA
Issue Type: Bug
Components: datacache
Affects Versions: 1.0.0
Reporter: Daniel Lee
I'm that sure whether this is a bug or not but what is observed is that the
application commit in the following code does not trigger commit on the
datacache.
=============================================================
EntityManagerFactory emf = Persistence.createEntityManagerFactory("demo");
EntityManager em = emf.createEntityManager();
em.getTransaction().begin();
Customer c = (Customer) em.createQuery("select c from Customer c where
c.name='Harry Auto'").getSingleResult();
em.getTransaction().commit();
=============================================================
Is this normal because there is no update? It make sense that there is no need
to flush on the database, but the datacache has been newly loaded with the
customer "Harry Auto" and the objects that are eagerly related to "Harry Auto".
If datacache is not committed, another transaction does not see the loaded
data in the data cache and will redundantly query the database again. Is this
a bug or working as design? Many thanks.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.