Finally it looks i found the solution.
I removed my Resource Jdbc from tomee.xml and it is loading and getting the
configurations done in persistance.xml.

Even though still i see that my query it is not really improved and it is
not hitting the cache.
I activated the stats and as result i get:
2017-04-24 15:12:19 INFO  StatisticalLoggingSessionEventListener:275 -
Session Metrics {
    892456 nanoseconds spent acquiring 27 JDBC connections;
    172511 nanoseconds spent releasing 27 JDBC connections;
    217866203 nanoseconds spent preparing 27 JDBC statements;
    2646336502 nanoseconds spent executing 27 JDBC statements;
    0 nanoseconds spent executing 0 JDBC batches;
    0 nanoseconds spent performing 0 L2C puts;
    1239845 nanoseconds spent performing 19 L2C hits;
    490312 nanoseconds spent performing 1 L2C misses;
    17828739 nanoseconds spent executing 1 flushes (flushing a total of 39
entities and 57 collections);
    6846 nanoseconds spent executing 1 partial-flushes (flushing a total of
0 entities and 0 collections)
}

and i am using the following code to activate the cache:
Query query =
createNamedQuery("Feed.findAll").setMaxResults(limit).setFirstResult(offset);
            query.setHint("org.hibernate.cacheable", true);
            return query.getResultList();

am i missing something?



--
View this message in context: 
http://tomee-openejb.979440.n4.nabble.com/Error-when-using-EH-Cache-with-Hibernate-tp4681560p4681585.html
Sent from the TomEE Dev mailing list archive at Nabble.com.

Reply via email to