感谢在前
在使用Spring+Hibernate声明式事务中,需要插入大量数据,为了提高插入效率,
需要每隔固定条数提交一次错误,但是在提交事务之后,声明式事务自动提交时就
会抛出异常:
Could not commit Hibernate transaction; nested exception is org.hibernate.Tra nsactionException: Transaction not successfully started
如何才能在声明事务中提交事务,而不产生异常?
代码如下:
异常信息如下: