Search in sources :

Example 1 with TimestampsCache

use of org.hibernate.cache.spi.TimestampsCache in project quarkus by quarkusio.

the class JPACacheDisabledTest method testNTransaction.

@Test
@Transactional
public void testNTransaction() {
    CacheImplementor cache = (CacheImplementor) session.getSessionFactory().getCache();
    TimestampsCache timestampsCache = cache.getTimestampsCache();
    Assertions.assertNull(timestampsCache);
}
Also used : TimestampsCache(org.hibernate.cache.spi.TimestampsCache) CacheImplementor(org.hibernate.cache.spi.CacheImplementor) Test(org.junit.jupiter.api.Test) QuarkusUnitTest(io.quarkus.test.QuarkusUnitTest) Transactional(javax.transaction.Transactional)

Example 2 with TimestampsCache

use of org.hibernate.cache.spi.TimestampsCache in project quarkus by quarkusio.

the class CRUDResource method checkCachingState.

@GET
@Produces(MediaType.TEXT_PLAIN)
@Path("/timestamps")
public String checkCachingState() {
    SessionImpl sessionImpl = em.unwrap(SessionImpl.class);
    TimestampsCache timestampsCache = sessionImpl.getSessionFactory().getCache().getTimestampsCache();
    return timestampsCache.getClass().getName();
}
Also used : TimestampsCache(org.hibernate.cache.spi.TimestampsCache) SessionImpl(org.hibernate.internal.SessionImpl) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Aggregations

TimestampsCache (org.hibernate.cache.spi.TimestampsCache)2 QuarkusUnitTest (io.quarkus.test.QuarkusUnitTest)1 Transactional (javax.transaction.Transactional)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1 CacheImplementor (org.hibernate.cache.spi.CacheImplementor)1 SessionImpl (org.hibernate.internal.SessionImpl)1 Test (org.junit.jupiter.api.Test)1