java - hazelcast-hibernate:caching is not happening -
i running sample application configurating hibernate sec level cache hazelcast. testing, running junit 2 times, in first run, db query getting called, db query not getting ached in sec run junit.
<prop key="hibernate.cache.use_second_level_cache">true</prop> <prop key="hibernate.cache.use_query_cache">true</prop> <prop key="hibernate.cache.use_minimal_puts">true</prop> <prop key="hibernate.cache.hazelcast.use_lite_member">true</prop> <prop key="hibernate.cache.region.factory_class">com.hazelcast.hibernate.hazelcastcacheregionfactory</prop>
could body allow know, need configuration in regard.
are sure session mill doesn't discarded between 2 consecutive unit test runs?
it depends on unit tests configurations theory says should run each test in isolation, because not guaranteed run in specific order.
you can test 2nd level cache in same unit test, need create sure test not @transactional , can @transactional service/dao twice.
in first transaction should nail database , loaded in 1st , 2nd level level cache.
in sec one, have new session entity should available in 2nd level level cache.
java hibernate caching hazelcast
No comments:
Post a Comment