开发者社区> 问答> 正文

hibernate4如何集成ocs的spymemcached?

想通过Java: Spymemcached客户端来访问ocs,在代码中与hibernate4集成时,hibernate-memcached1.3找不到类com.googlecode.hibernate.memcached.MemcachedRegionFactory。

展开
收起
唐诺 2015-04-17 11:16:32 8001 0
1 条回答
写回答
取消 提交回答
  • Rehibernate4如何集成ocs的spymemcached?
    Caused by: java.lang.ClassNotFoundException: Could not load requested class : com.googlecode.hibernate.memcached.MemcachedRegionFactory

    -------------------------

    Rehibernate4如何集成ocs的spymemcached?
    <!-- hibernate cache config -->
                    <!-- 开启二级缓存 -->
                    <prop key="hibernate.cache.use_second_level_cache">true</prop>
                    <!-- 是否缓存查询结果 -->
                    <prop key="hibernate.cache.use_query_cache">true</prop>
                    <!-- 缓存提供商 hibernate3配置 -->
                    <!-- <prop key="hibernate.cache.provider_class ">com.googlecode.hibernate.memcached.MemcachedCacheProvider</prop> -->
                    <!-- 缓存提供商 hibernate4配置 -->
                    <prop key="hibernate.cache.region.factory_class">com.googlecode.hibernate.memcached.MemcachedRegionFactory</prop>
                    <!-- 设置二级缓存的前缀名称 -->
                    <prop key="hibernate.cache.region_prefix">alltest_memcache</prop>
                    <!-- 否使用结构化的方式缓存对象
                    <prop key="hibernate.cache.use_structured_entries">true</prop>
                    强制Hibernate以更人性化的格式将数据存入二级缓存
                    <prop key="hibernate.cache.use_structured_entries">true</prop>
                    Hibernate将收集有助于性能调节的统计数据
                    <prop key="hibernate.generate_statistics">true</prop> -->
                    <!-- 切换使用不同的memcache客户端(SpyMemcacheClientFactory) -->
                    <prop key="hibernate.memcached.memcacheClientFactory">com.googlecode.hibernate.memcached.spymemcached.SpyMemcacheClientFactory</prop>
                    <prop key="hibernate.memcached.servers">${hibernate.memcached.servers}</prop>
                    <prop key="hibernate.memcached.cacheTimeSeconds">${hibernate.memcached.cacheTimeSeconds}
    2015-04-17 11:18:10
    赞同 展开评论 打赏
问答标签:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
Cloud Foundry on Cloud-- 开源PaaS集成技术实现 立即下载
生态与兼容MaxCompute大数据生态集成和开发工具 立即下载
集成智能接入网关APP:优化企业级移动办公网络 立即下载