如果session是通过session = this.getHibernateTemplate().getSessionFactory().getCurrentSession();
这样的方式得到的,那么要在方法加上@Transactional这个标签,
不然的话,会报
org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here
这个异常