non-transactional
阿新 • • 發佈:2018-04-14
報錯 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:methodname="*" propagation="REQUIRED" /> </tx:attributes> </tx:advice>
non-transactional