-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: HHH000352: in StatelessSession on rollback with JDBC batch
PostPosted: Wed May 03, 2017 7:14 am 
Newbie

Joined: Wed Apr 19, 2017 8:15 am
Posts: 6
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().
Quote:
ResourceRegistryStandardImpl.close(Statement) line: 148
ResourceRegistryStandardImpl.releaseResources() line: 292
LogicalConnectionManagedImpl(AbstractLogicalConnectionImplementor).afterTransaction() line: 55
LogicalConnectionManagedImpl.afterTransaction() line: 149
LogicalConnectionManagedImpl.afterCompletion() line: 260
LogicalConnectionManagedImpl(AbstractLogicalConnectionImplementor).rollback() line: 122
JdbcResourceLocalTransactionCoordinatorImpl$TransactionDriverControlImpl.rollback() line: 239
TransactionImpl.rollback() line: 100
HTransaction.rollback(boolean) line: 179
HTransaction.rollback() line: 157
DBContextSingleton(AbstractDBContext).rollback() line: 113
HibernateJDBCBatch.testBatchSize(HSessionFactory) line: 145
HibernateJDBCBatch.work() line: 51
HibernateJDBCBatch(AbstractTestDBAnwendung).start(String[]) line: 176
HibernateJDBCBatch.main(String[]) line: 38


There should not be an error message, since everything is clear up in rollback.
Instead rollback should close the batch too.


Top
 Profile  
 
 Post subject: Re: HHH000352: in StatelessSession on rollback with JDBC batch
PostPosted: Wed May 03, 2017 10:21 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
Are you using the latest Hibernate version, 5.2.10?


Top
 Profile  
 
 Post subject: Re: HHH000352: in StatelessSession on rollback with JDBC batch
PostPosted: Thu May 04, 2017 11:04 am 
Newbie

Joined: Wed Apr 19, 2017 8:15 am
Posts: 6
Yes, same problem with hibernate 5.2.10.


Top
 Profile  
 
 Post subject: Re: HHH000352: in StatelessSession on rollback with JDBC batch
PostPosted: Thu May 04, 2017 11:16 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
If you can come up with a replicating test case, then you should open a new Jira issue and attach the test case.


Top
 Profile  
 
 Post subject: Re: HHH000352: in StatelessSession on rollback with JDBC batch
PostPosted: Tue May 09, 2017 11:11 am 
Newbie

Joined: Wed Apr 19, 2017 8:15 am
Posts: 6
Its in Jira now:

https://hibernate.atlassian.net/browse/HHH-11732


Top
 Profile  
 
 Post subject: Re: HHH000352: in StatelessSession on rollback with JDBC batch
PostPosted: Wed May 10, 2017 1:06 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
Thanks.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.