openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Lee (JIRA)" <j...@apache.org>
Subject [jira] Created: (OPENJPA-265) datacache does not get committed when application commit after a query
Date Sun, 24 Jun 2007 22:46:25 GMT
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.


Mime
View raw message