spring的hibernateTemplate中施行sql语句

spring的hibernateTemplate中执行sql语句org.hibernate.HibernateException: No Hibernate Session bound

spring的hibernateTemplate中执行sql语句

org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here
?

注意此处要用openSession!

?

this.getHibernateTemplate().getSessionFactory().openSession().createSQLQuery(sql).executeUpdate();