# Can't call rollback when autocommit=true \[InnoDB\]

**URL:** <https://discourse.hibernate.org/t/cant-call-rollback-when-autocommit-true-innodb/2455>\
**Category:** Hibernate ORM\
**Created:** [March 18, 2019, 5:30pm UTC](https://discourse.hibernate.org/t/cant-call-rollback-when-autocommit-true-innodb/2455 "2019-03-18T17:30:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![DmanRJ](https://avatars.discourse-cdn.com/v4/letter/d/6de8d8/32.png) [@DmanRJ](https://discourse.hibernate.org/u/DmanRJ)\
**Post date:** [March 18, 2019, 5:30pm UTC](https://discourse.hibernate.org/t/cant-call-rollback-when-autocommit-true-innodb/2455/1 "2019-03-18T17:30:39Z")

</div>

i’m having a strange problem with jboss + hibernate + mysql (InnoDB table)

Sometimes (it’s not predictable) it gives:

com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Can’t call rollback when autocommit=true

org.jboss.jca.core.spi.transaction.local.LocalResourceException: Can’t call rollback when autocommit=true

even if in my hibernate.cfg.xml i have:  
`
<property name=“hibernate.connection.autocommit”>false</property>
`  
How is that possible?

---

<div class="post-metadata">

**Author:** ![DmanRJ](https://avatars.discourse-cdn.com/v4/letter/d/6de8d8/32.png) [@DmanRJ](https://discourse.hibernate.org/u/DmanRJ)\
**Post date:** [March 20, 2019, 9:13am UTC](https://discourse.hibernate.org/t/cant-call-rollback-when-autocommit-true-innodb/2455/2 "2019-03-20T09:13:01Z")

</div>

In the stacktrace there is:

07:38:40,019 WARN [org.jboss.jca.core.connectionmanager.TxConnectionManager] (HTTP-1854) IJ000401: Error during tidy up connection: org.jboss.jca.core.connectionmanager.listener.TxConnectionListener@2138e44e[state=DESTROYED managed connection=org.jboss.jca.adapters.jdbc.local.LocalManagedConnection@2e118f82 connection handles=0 lastUse=1552973737275 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool@4c2b3265 pool internal context=SemaphoreArrayListManagedConnectionPool@14d6dde7[pool=ApplicationDS] xaResource=LocalXAResourceImpl@54bacd22[connectionListener=2138e44e connectionManager=23c9f8e2 warned=false currentXid=null productName=MySQL productVersion=5.6.10-log jndiName=java:/ApplicationDS] txSync=null]: org.jboss.jca.core.spi.transaction.local.LocalResourceException: Can’t call rollback when autocommit=true

---

<div class="post-metadata">

**Author:** ![DmanRJ](https://avatars.discourse-cdn.com/v4/letter/d/6de8d8/32.png) [@DmanRJ](https://discourse.hibernate.org/u/DmanRJ)\
**Post date:** [March 21, 2019, 10:49am UTC](https://discourse.hibernate.org/t/cant-call-rollback-when-autocommit-true-innodb/2455/3 "2019-03-21T10:49:22Z")

</div>

Is it possible that concurrent session read from an unpredictable state table?

Example:  
HTTP REQUEST 01 Session 1 -\> Write on table\_A, Session 1 is not closed  
HTTP REQUEST 02 Session 2 -\> Read on table\_A  
for some reason operation done by Session 1 is rolled back  
HTTP REQUEST 02 Session 2 -\> Gives the warn ?

Can you please help ?

---

<div class="post-metadata">

**Author:** ![DmanRJ](https://avatars.discourse-cdn.com/v4/letter/d/6de8d8/32.png) [@DmanRJ](https://discourse.hibernate.org/u/DmanRJ)\
**Post date:** [March 25, 2019, 6:02pm UTC](https://discourse.hibernate.org/t/cant-call-rollback-when-autocommit-true-innodb/2455/4 "2019-03-25T18:02:55Z")

</div>

Can you please help ?

---

<div class="post-metadata">

**Author:** ![DmanRJ](https://avatars.discourse-cdn.com/v4/letter/d/6de8d8/32.png) [@DmanRJ](https://discourse.hibernate.org/u/DmanRJ)\
**Post date:** [March 28, 2019, 11:04am UTC](https://discourse.hibernate.org/t/cant-call-rollback-when-autocommit-true-innodb/2455/5 "2019-03-28T11:04:29Z")

</div>

No one can give any hints ?

---

<div class="post-metadata">

**Author:** ![DmanRJ](https://avatars.discourse-cdn.com/v4/letter/d/6de8d8/32.png) [@DmanRJ](https://discourse.hibernate.org/u/DmanRJ)\
**Post date:** [April 3, 2019, 4:32pm UTC](https://discourse.hibernate.org/t/cant-call-rollback-when-autocommit-true-innodb/2455/6 "2019-04-03T16:32:31Z")

</div>

Still no one with any idea ?
