1. 程式人生 > >non-transactional

non-transactional

報錯 eat pla ren () rop ref advice property

this.getHibernateTemplate().getSessionFactory().getCurrentSession().createQuery(queryString)報錯No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here,因為沒有配置事務

        <bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"
> <property name="sessionFactory" ref="sessionFactory" /> <property name="dataSource" ref="dataSource"/> </bean> <tx:advice id="txAdvice" transaction-manager="txManager"> <tx:attributes> <tx:method
name="*" propagation="REQUIRED" /> </tx:attributes> </tx:advice>

non-transactional