是的,我们能够使用2级缓存配置hibernate状态。虽然没有使用beantalk。此代码应该可以帮助您。
<props> <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop> <prop key="hibernate.show_sql">false</prop> <prop key="hibernate.format_sql">false</prop> <prop key="hibernate.generate_statistics">true</prop> <prop key="hibernate.cache.use_structured_entries">true</prop> <!-- prop key="hibernate.hbm2ddl.auto" >update</prop --> <prop key="hibernate.jdbc.batch_size">100</prop> <prop key="hibernate.cache.provider_class">com.googlepre.hibernate.memcached.MemcachedCacheProvider </prop> <!-- Cache disabled --> <prop key="hibernate.cache.use_query_cache">true</prop> <prop key="hibernate.cache.use_second_level_cache">true</prop> <prop key="hibernate.memcached.servers"><elasticachehostname>:11211</prop> <prop key="hibernate.memcached.cacheTimeSeconds">300</prop> <prop key="hibernate.memcached.connectionFactory">DefaultConnectionFactory</prop> <prop key="hibernate.memcached.clearSupported">false</prop> </props>
您还需要hibernate的memcached jar
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)