# On release of batch it still contained JDBC statements

**URL:** <https://discourse.hibernate.org/t/on-release-of-batch-it-still-contained-jdbc-statements/1540>\
**Category:** Hibernate ORM\
**Created:** [October 17, 2018, 3:06pm UTC](https://discourse.hibernate.org/t/on-release-of-batch-it-still-contained-jdbc-statements/1540 "2018-10-17T15:06:23Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![codylerum](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/codylerum/32/3548_2.png) [@codylerum](https://discourse.hibernate.org/u/codylerum)\
**Post date:** [October 17, 2018, 3:06pm UTC](https://discourse.hibernate.org/t/on-release-of-batch-it-still-contained-jdbc-statements/1540/1 "2018-10-17T15:06:24Z")

</div>

After updating from 5.1.10 to 5.3.6 I’m starting to see the log message

`On release of batch it still contained JDBC statements`

I’ve debugged where that is getting logged and all I can find is a single statement which doesn’t

```auto
insert into EventLog (entityId, entityType, ipAddress, message, time, user, id) values (?, ?, ?, ?, ?, ?, ?)

```

But I can’t find where the associated values are stored (if there even are any).

Any suggestions in further tracking this down? The only insert that is being created is actually being persisted to the database.

---

<div class="post-metadata">

**Author:** ![vlad](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/vlad/32/658_2.png) [@vlad](https://discourse.hibernate.org/u/vlad)\
**Post date:** [October 17, 2018, 3:25pm UTC](https://discourse.hibernate.org/t/on-release-of-batch-it-still-contained-jdbc-statements/1540/2 "2018-10-17T15:25:52Z")

</div>

Try to replicate it with this test case:

[http://in.relation.to/2016/01/14/hibernate-jpa-test-case-template/](http://in.relation.to/2016/01/14/hibernate-jpa-test-case-template/)

We’ll investigate it afterward.

---

<div class="post-metadata">

**Author:** ![codylerum](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/codylerum/32/3548_2.png) [@codylerum](https://discourse.hibernate.org/u/codylerum)\
**Post date:** [October 17, 2018, 8:35pm UTC](https://discourse.hibernate.org/t/on-release-of-batch-it-still-contained-jdbc-statements/1540/3 "2018-10-17T20:35:19Z")

</div>

@vlad unfortunately I haven’t been able to get it to trigger with simple test case. ( [https://github.com/codylerum/hibernate-test-case-templates/blob/batch\_statements/orm/hibernate-orm-5/src/test/java/org/hibernate/bugs/JPAUnitTestCase.java](https://github.com/codylerum/hibernate-test-case-templates/blob/batch_statements/orm/hibernate-orm-5/src/test/java/org/hibernate/bugs/JPAUnitTestCase.java) )

I’m going to try with a simple EE8 project. If I can get it to there maybe someone can help me reverse it back into a hiberate test.

---

<div class="post-metadata">

**Author:** ![codylerum](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/codylerum/32/3548_2.png) [@codylerum](https://discourse.hibernate.org/u/codylerum)\
**Post date:** [October 17, 2018, 9:23pm UTC](https://discourse.hibernate.org/t/on-release-of-batch-it-still-contained-jdbc-statements/1540/4 "2018-10-17T21:23:35Z")

</div>

@vlad

I was able to reproduce this with a super simple Java EE8 project that will deploy on Wildfly 14.0.1.Final

> **[codylerum/demos](https://github.com/codylerum/demos/tree/master/jpa-batch-release)**
>
> Contribute to codylerum/demos development by creating an account on GitHub.

Browsing to [http://localhost:8080/demo](http://localhost:8080/demo) and clicking execute you will see the log messages

```auto
21:17:40,824 INFO [stdout] (default task-1) Executing

21:17:40,827 INFO [org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl] (default task-1) HHH000010: On release of batch it still contained JDBC statements
21:17:40,827 ERROR [org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl] (default task-1) HHH000352: Unable to release batch statement...

```

---

<div class="post-metadata">

**Author:** ![vlad](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/vlad/32/658_2.png) [@vlad](https://discourse.hibernate.org/u/vlad)\
**Post date:** [October 18, 2018, 4:30am UTC](https://discourse.hibernate.org/t/on-release-of-batch-it-still-contained-jdbc-statements/1540/5 "2018-10-18T04:30:07Z")

</div>

If you cannot replicate it with our test case, it’s an integration issue.

Since you mentioned Wildfly, this issue is best addressed by the Wildfly team since it could be related to how the Session or the Transaction are handled.

Maybe @scott.marlow can help us with this issue.

---

<div class="post-metadata">

**Author:** ![codylerum](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/codylerum/32/3548_2.png) [@codylerum](https://discourse.hibernate.org/u/codylerum)\
**Post date:** [October 18, 2018, 1:44pm UTC](https://discourse.hibernate.org/t/on-release-of-batch-it-still-contained-jdbc-statements/1540/6 "2018-10-18T13:44:55Z")

</div>

Thanks @vlad I’ll fire up an issue on the Wildfly side.

---

<div class="post-metadata">

**Author:** ![codylerum](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/codylerum/32/3548_2.png) [@codylerum](https://discourse.hibernate.org/u/codylerum)\
**Post date:** [October 18, 2018, 2:27pm UTC](https://discourse.hibernate.org/t/on-release-of-batch-it-still-contained-jdbc-statements/1540/7 "2018-10-18T14:27:07Z")

</div>

[https://issues.jboss.org/browse/WFLY-11213](https://issues.jboss.org/browse/WFLY-11213)

---

<div class="post-metadata">

**Author:** ![codylerum](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/codylerum/32/3548_2.png) [@codylerum](https://discourse.hibernate.org/u/codylerum)\
**Post date:** [October 18, 2018, 4:06pm UTC](https://discourse.hibernate.org/t/on-release-of-batch-it-still-contained-jdbc-statements/1540/8 "2018-10-18T16:06:33Z")

</div>

For anyone following along @scott.marlow investigated and suggested I open an HHH issue.

[https://hibernate.atlassian.net/browse/HHH-13050](https://hibernate.atlassian.net/browse/HHH-13050)
