# Behavior when hibernate.connection.autocommit set to false

**URL:** <https://discourse.hibernate.org/t/behavior-when-hibernate-connection-autocommit-set-to-false/1614>\
**Category:** Hibernate ORM\
**Created:** [October 29, 2018, 4:57pm UTC](https://discourse.hibernate.org/t/behavior-when-hibernate-connection-autocommit-set-to-false/1614 "2018-10-29T16:57:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pushkar\_Deole](https://avatars.discourse-cdn.com/v4/letter/p/bb73d2/32.png) [@Pushkar\_Deole](https://discourse.hibernate.org/u/Pushkar_Deole)\
**Post date:** [October 29, 2018, 4:57pm UTC](https://discourse.hibernate.org/t/behavior-when-hibernate-connection-autocommit-set-to-false/1614/1 "2018-10-29T16:57:41Z")

</div>

Hello Vlad,

What will be the behavior when following configuration is done in hibernate.cfg.xml file:

```
	<property name="hibernate.connection.autocommit">false</property>

```

In this case, how does hibernate handle the updates/inserts which are done outside a transaction?

---

<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 29, 2018, 5:20pm UTC](https://discourse.hibernate.org/t/behavior-when-hibernate-connection-autocommit-set-to-false/1614/2 "2018-10-29T17:20:35Z")

</div>

The [User Guide explains all configuration properties](http://docs.jboss.org/hibernate/orm/5.3/userguide/html_single/Hibernate_User_Guide.html#configurations-database-connection).

> In this case, how does hibernate handle the updates/inserts which are done outside a transaction?

An exception will be thrown if you try to flush any change outside of a JPA/Hibernate transaction. Only queries are permitted outside of a JPA/Hibernate transaction.
