升级Hibernate到4.1,抛出异常:
Caused by: org.hibernate.cache.NoCacheRegionFactoryAvailableException: Second-level cache is used in the application, but property hibernate.cache.region.factory_class is not given, please either disable second level cache or set correct region factory class name to property hibernate.cache.region.factory_class (and make sure the second level cache provider, hibernate-infinispan, for example, is available in the classpath). at org.hibernate.cache.internal.NoCachingRegionFactory.buildTimestampsRegion(NoCachingRegionFactory.java:87)
项目是基于springside3.2升级Hibernate到4.1版本,applicationContext.xml关于Hibernate3.3的配置如下
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name="namingStrategy"> <bean class="org.hibernate.cfg.ImprovedNamingStrategy" /> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">${hibernate.dialect}</prop> <prop key="hibernate.show_sql">${hibernate.show_sql}</prop> <prop key="hibernate.format_sql">${hibernate.format_sql}</prop> <prop key="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider </prop> <prop key="hibernate.cache.provider_configuration_file_resource_path">${hibernate.ehcache_config_file}</prop> </props> </property> <property name="packagesToScan" value="com.carton.oa.entity.*" /> </bean> <!-- Hibernate3 事务管理器配置,单数据源事务 --> <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory" /> </bean>
升级之后Hibernate的配置也需要做相应的修改,Hibernate4.1配置如下
<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name="namingStrategy"> <bean class="org.hibernate.cfg.ImprovedNamingStrategy" /> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">${hibernate.dialect}</prop> <prop key="hibernate.show_sql">${hibernate.show_sql}</prop> <prop key="hibernate.format_sql">${hibernate.format_sql}</prop> <prop key="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.EhCacheRegionFactory </prop> <prop key="hibernate.cache.provider_class">net.sf.ehcache.hibernate.EhCacheProvider</prop> <prop key="hibernate.cache.provider_configuration_file_resource_path">${hibernate.ehcache_config_file}</prop> </props> </property> <property name="packagesToScan" value="com.jbase.entity.*" /> </bean> <!-- Hibernate4 事务管理器配置,单数据源事务 --> <bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory" /> </bean>
相关推荐
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/...
weblogic12 下最新 org.hibernate.hql.ast.HqlToken解决办法
No Hibernate Session bound to thread,没有绑定线程解决办法,找了好久才找到的
整合了hibernate所需的全套jar包包括日志jar包以及mysql的连接jar包,希望对大家有所帮助
hibernate-validator 5.3.5.Final jar包 ;desc:if you want validator your project
hibernate-release-5.0.7.Final的源码,有需要的人可以下载
包含hibernate所有所需jar包还有一些其他包日志包、jpa支持包等: 列如:hibernate-core-5.1.0.Final.jar hibernate-ehcache-5.1.0.Final.jar hibernate-entitymanager-5.1.0.Final.jar hibernate-envers-5.1.0....
Maven坐标:org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.2.Final; 标签:hibernate、javax、persistence、jpa、api、中英对照文档、jar包、java; 使用方法:解压翻译后的API文档,用浏览器打开...
<property name="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.EhCacheRegionFactory 3.3配置如下: <property name="hibernate.cache.use_second_level_cache">true <property name="cache...
很多人为了配置jpa找这个动态产生字节码的jar文件,hibernate-distribution-3.3.1.GA包太大,而hibernate-distribution-3.3.2.GA的jar没有这个jar文件,希望对大家有用
hibernate-validator-6.0.14.Final.jar
hibernate-entitymanager-3.4.0.GA.rar hibernate-entitymanager-3.4.0.GA.rar hibernate-entitymanager-3.4.0.GA.rar hibernate-entitymanager-3.4.0.GA.rar hibernate-entitymanager-3.4.0.GA.rar hibernate-...
org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.connections.spi.ConnectionProvider] at org.hibernate.service.internal....
myeclipse的自带hibernate jar包不支持注解;自己找的hibernate注解所需的jar包:hibernate-core;hibernate-annotation;hbm-cfg-xml;log4j.properties
Hibernate ORM 6.0.0.Alpha7版本。 参见http://hibernate.org/orm/releases/6.0 org.hibernate/hibernate-entitymanager/5.4.32.Final/hibernate-entitymanager-5.4.32.Final.jar
内含hibernate3.2与修复java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.(Z)V 的错误的cglib2.2
基于hibernate的开源通用查询框架: 1.支持全部hql语法 2.可以支持Ajax用的 xml数据结构,也可以支持jsp、jstl、struts等标签,根据配置不同的数据解析器,得到不同结构的数据。 3.集成完整的分页功能。 4....
hibernate开发需要hibernate-release-5.0.7.Final可下载
Caused by: org.hibernate.boot.registry.selector.spi.StrategySelectionException: Unable to resolve name [org.hibernate.connection.C3P0ConnectionProvider] as strategy [org.hibernate.engine.jdbc.... ...