这是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版本已经修复了这个问题

相关文章:

  • 2022-12-23
  • 2021-07-07
  • 2021-06-21
  • 2022-12-23
  • 2021-07-03
  • 2021-10-29
  • 2022-12-23
  • 2021-07-31
猜你喜欢
  • 2021-08-05
  • 2021-11-29
  • 2021-08-28
  • 2022-12-23
  • 2021-06-29
  • 2021-10-14
  • 2021-08-09
相关资源
相似解决方案