开启事务之前先判断事务是否已经打开,方法如下:
JdbcTransaction tx=(JdbcTransaction) session.beginTransaction();
改为
JdbcTransaction tx = session.getTransaction().getLocalStatus()==LocalStatus.ACTIVE?(JdbcTransaction)session.getTransaction():(JdbcTransaction) session.beginTransaction();
hibernate exception nested transactions not supported 解决方法
原文:http://www.cnblogs.com/microbear/p/5615560.html