Hibernate - HHH000352: Unable to release batch statement
Posted 水木羽人
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Hibernate - HHH000352: Unable to release batch statement相关的知识,希望对你有一定的参考价值。
这是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的主要内容,如果未能解决你的问题,请参考以下文章
Hibernate 4.1.2 HHH000342:无法获得与查询元数据的连接:没有为 jdbc:hsqldb:mem:test 找到合适的驱动程序
ERROR org.hibernate.internal.SessionImpl - HHH000346: Error during managed flush [object references
Hibernate里面表间有连接,查询一个表出org.hibernate.HibernateException: HHH000142: Javassist Enhancement failed: 表联