spring+hibernate+mysql执行HQL查询报未打开游标错误

2019-03-25 13:47|来源: 网路

spring配置:
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
	<property name="jndiName">
		<value>java:comp/env/jdbc/MY</value>
	</property>
</bean>

<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
        <property name="dataSource" ref="dataSource"/>
        <property name="hibernateProperties">
            <props>
				<prop key="hibernate.dialect">
					org.hibernate.dialect.MySQL5InnoDBDialect
				</prop>
				<prop key="hibernate.show_sql">true</prop>           									
						
				<prop key="hibernate.max_fetch_depth">0</prop> 		
				<prop key="hibernate.jdbc.fetch_size">100</prop>
				<prop key="hibernate.jdbc.batch_size">50</prop>
				<prop key="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</prop>
			 </props>
				
        </property>
            </bean>

<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"
			p:sessionFactory-ref="sessionFactory"/>



执行HibernateTemplate的HQL查询语句(如:getHibernateTemplate().find("from SysUser")方法)时候报错:  The statement (1) has no open cursor.

有遇到过同样问题的吗?

相关问答

更多