这是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的更多相关文章

  1. 使用hibernate时出现 org.hibernate.HibernateException: Unable to get the default Bean Validation factory

    hibernate 在使用junit测试报错: org.hibernate.HibernateException: Unable to get the default Bean Validation ...

  2. juit测试中报错:org.hibernate.HibernateException: Unable to get the default Bean Validation factory

    org.hibernate.HibernateException: Unable to get the default Bean Validation factory 解决方法: 解决方案: 在hib ...

  3. HTTP Status 500 - Request processing failed; nested exception is org.hibernate.exception.GenericJDBCException: could not execute statement

    1.什么操作出现:当我在项目中添加产品或者修改时,浏览器出现HTTP Status 500 - Request processing failed; nested exception is org.h ...

  4. Caused by:org.hibernate.HibernateException:Unable to make JDBC Connection

    1.错误描述 Caused by:org.hibernate.HibernateException:Unable to make JDBC Connection[jdbc\:mysql\://loca ...

  5. Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable t

    spring与hibernate整合然后出现如下错误: org.springframework.beans.factory.BeanCreationException: Error creating ...

  6. Spring JUnit org.hibernate.HibernateException: Unable to get the default Bean Validation factory

    org.hibernate.HibernateException: Unable to get the default Bean Validation factory <property nam ...

  7. org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]

    使用Hibernate 插入List数据时出现了以下异常: SLF4J: The requested version 1.6 by your slf4j binding is not compatib ...

  8. Caused by: org.hibernate.HibernateException: Unable to build the default ValidatorFactory

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'testAction': ...

  9. org.hibernate.QueryException: Unable to resolve path [SecWilldosetdate.name],xxxxxxxx...异常处理

    今天在写hql语句的时候出现了这个错误,然后一直运行到执行hql这儿就出错了.页面报500. 原hql如下: String hql = "from SecWilldosetdate wher ...

随机推荐

  1. LeetCode 206.反转链表(Python3)

    题目: 反转一个单链表. 示例: 输入: 1->2->3->4->5->NULL 输出: 5->4->3->2->1->NULL 进阶:你可 ...

  2. github和gitlab仓库一起使用

    github是网络公有代码仓库,一般用于私人代码托管,而gitlab一般是企业搭建的内部代码仓库.工作期间,我们都会同时用到这两个仓库.可公司邮箱与个人邮箱是不同的,由此产生的 SSH key 也是不 ...

  3. 使用java代码动态配置与xml文件结合的方式使用mybatis-generator生成代码配置

    1.使用java代码动态配置与xml文件结合的方式使用mybatis-generator生成代码配置 2.上代码:在resources目录下新建:generatorConfiguration.xml文 ...

  4. JAVA 垃圾回收读书笔记

    对象已死 在JAVA代码运行中,会不停的创建对象,因为内存空间不是无限的,Java虚拟机必须不停的回收无用的数据空间.那么虚拟机是怎么判断对象空间是需要被回收的呢,也就是怎么样的数据算是垃圾数据呢? ...

  5. golang和python的二进制转换

    1.二进制转换规则 比如13,对13整除2,余数1,整除变为6,依次类推 13/2=6余1 6/2=3余0 3/2=1余1 1/2=0余1 所以最后的结果为1101 2.python def conv ...

  6. JS 根据今天的日期获取本周星期一与星期天的日期

    var now = new Date(); var nowTime = now.getTime() ; var day = now.getDay(); var oneDayTime = 24*60*6 ...

  7. SQL中的long text

    SQL中的long text 问题: 解决方法: SELECT CONVERT(VARCHAR(5000),参考文献) AS 参考文献 FROM tpi20160503 出现原因:

  8. Windows下运行Tomcat闪退问题

    直接双击startup.bat后闪退,可能的原因是tomcat的配置没有完全正确 完整的tomcat的配置应该配置: 1.JAVA_HOME 2.CATALINA_HOME 3.Path:%CATAL ...

  9. java浮点运算的陷阱

    首先呢,i你要明白double和float. Inifinity: 例如:syso(5.0/0.0+" 和"+0.0 /0.0); 浮点运算的0.0不是真正意义上的0,而是非常接近 ...

  10. JS基础语法之DOM01(找标签、改属性样式)

    DOM:暂时可以理解为找标签.改样式 1.BOM:   记住location这个就可以: location.href 获得当前页面的URL location.href = "URL" ...