码迷,mamicode.com
首页 > Web开发 > 详细

Hibernate - HHH000352: Unable to release batch statement

时间:2017-09-20 18:05:59      阅读:228      评论:0      收藏:0      [点我收藏+]

标签:问题   title   uil   nts   back   hiberna   mode   http   ase   

这是hibernate的一个bug,具体看https://hibernate.atlassian.net/browse/HHH-11732?attachmentViewMode=list

When using stateless session with jdbc batch size we get an

HHH000352: Unable to release batch statement..

error in session.close() after rollback:

Code:
Configuration cfg = new Configuration();
cfg.setProperty(Environment.STATEMENT_BATCH_SIZE, "10");
factory = cfg.configure().buildSessionFactory();

StatelessSession session = factory.openStatelessSession();
Transaction tx = session.beginTransaction();

Employee employee = new Employee("1", "2", 1);
employee.setId(id++);
session.insert(employee);

tx.rollback();

session.close();

In rollback the statements are closed but still remain in the jdbc batch,
which is trying to close them a second time on session.close().

 

5.2.11.Final版本已经修复了这个问题

Hibernate - HHH000352: Unable to release batch statement

标签:问题   title   uil   nts   back   hiberna   mode   http   ase   

原文地址:http://www.cnblogs.com/firejava/p/7562464.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!