org.springframework.transaction.TransactionSystemExcepti
最近在写操作CLOB的过程中总是报这个异常,数据去插入进去了.
先看看SessionFactory.getCurrentSession与openSession的区别
1. 如果使用的是getCurrentSession来创建session的话,在commit后,session就自动被关闭了,
开始用的:
Session session = this.getHibernateTemplate().getSessionFactory().getCurrentSession();
Transaction tran=session.beginTransaction();
好多文章里都说只需在Spring配置
修改后的:
Session session = this.getHibernateTemplate().getSessionFactory().openSession();
Transaction tran=session.beginTransaction();
......
finally
问题解决