# Setting TRANSACTION\_READ\_COMMITED on Interbase Configuration properties for Interbase Interclient Hibernate

**URL:** <https://discourse.hibernate.org/t/setting-transaction-read-commited-on-interbase-configuration-properties-for-interbase-interclient-hibernate/47>\
**Category:** Hibernate ORM\
**Created:** [January 10, 2018, 7:16pm UTC](https://discourse.hibernate.org/t/setting-transaction-read-commited-on-interbase-configuration-properties-for-interbase-interclient-hibernate/47 "2018-01-10T19:16:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![blyons](https://avatars.discourse-cdn.com/v4/letter/b/8797f3/32.png) [@blyons](https://discourse.hibernate.org/u/blyons)\
**Post date:** [January 10, 2018, 7:16pm UTC](https://discourse.hibernate.org/t/setting-transaction-read-commited-on-interbase-configuration-properties-for-interbase-interclient-hibernate/47/1 "2018-01-10T19:16:06Z")

</div>

Our project is using Firebird / Interbase databases. In Firebird we can set additional  
Configuration parameters via the following code:

However, this does not apply (work) for Interbase. Where are the capabilities of the Interbase hibernate driver documented?

import org.hibernate.cfg.Configuration;

public class Test{

```
public final Configuration getConfiguration(final ConnectParameters connectParams) {
	
	final String configFile = connectParams.getConfigFile();
	final URL configLoc = this.getClass().getResource(configFile);
	final Configuration config= new Configuration().configure(configLoc);

	config.setProperty("hibernate.connection.username", connectParams.getUsername());
	config.setProperty("hibernate.connection.password", connectParams.getPassword());
	config.setProperty("hibernate.connection.url", connectParams.getConnectString());
	config.setProperty("hibernate.connection.dialect", connectParams.getDialect());
	config.setProperty("hibernate.connection.driver_class", connectParams.getDriverClass());

	 if (connectParams.getConnectString().contains("firebird")) {
	  setupConfig.setProperty(
	  "hibernate.connection.TRANSACTION_READ_COMMITTED",
	  "isc_tpb_nowait,isc_tpb_read_committed,isc_tpb_no_rec_version");
	 }

	return config;

}

```

}

---

<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:** [January 10, 2018, 8:09pm UTC](https://discourse.hibernate.org/t/setting-transaction-read-commited-on-interbase-configuration-properties-for-interbase-interclient-hibernate/47/2 "2018-01-10T20:09:32Z")

</div>

If you only use the `hibernate.connection` configuration, Hibernate will pick the `DriverManagerConnectionProvider` which is not meant for production.

Better use the `HikariConnectionProvider` and set the isolation level at the connection pool level:

```auto
HikariConfig config = new HikariConfig();
config.setAutoCommit(false);
config.setTransactionIsolation("TRANSACTION_READ_COMMITTED");

```

HikariCP is one of the best [connection pool](https://vladmihalcea.com/the-anatomy-of-connection-pooling/) in Java.

You might want to set the `hibernate.connection.provider_disables_autocommit` property to delay the connection acquisition. For more details, check out [this article](https://vladmihalcea.com/why-you-should-always-use-hibernate-connection-provider_disables_autocommit-for-resource-local-jpa-transactions/).

---

<div class="post-metadata">

**Author:** ![blyons](https://avatars.discourse-cdn.com/v4/letter/b/8797f3/32.png) [@blyons](https://discourse.hibernate.org/u/blyons)\
**Post date:** [January 10, 2018, 10:33pm UTC](https://discourse.hibernate.org/t/setting-transaction-read-commited-on-interbase-configuration-properties-for-interbase-interclient-hibernate/47/3 "2018-01-10T22:33:54Z")

</div>

Thanks for the prompt reply Vlad. I’ll check it out and will get back with you.

---

<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:** [January 11, 2018, 8:40am UTC](https://discourse.hibernate.org/t/setting-transaction-read-commited-on-interbase-configuration-properties-for-interbase-interclient-hibernate/47/4 "2018-01-11T08:40:31Z")

</div>

Thanks. I’m glad I could help.

---

<div class="post-metadata">

**Author:** ![mrotteveel](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/mrotteveel/32/28_2.png) [@mrotteveel](https://discourse.hibernate.org/u/mrotteveel)\
**Post date:** [January 11, 2018, 10:03am UTC](https://discourse.hibernate.org/t/setting-transaction-read-commited-on-interbase-configuration-properties-for-interbase-interclient-hibernate/47/5 "2018-01-11T10:03:09Z")

</div>

This doesn’t address the problem of the OP. The OP wants to redefine a transaction isolation level, not set a transaction isolation level. This is possible with Jaybird, the JDBC driver for Firebird. Jaybird has a default for READ\_COMMITTED as `isc_tpb_read_committed,isc_tpb_rec_version,isc_tpb_write,isc_tpb_wait` (or read committed, read/write, read latest committed record version, wait for locks).

The configuration shown redefines this to read committed, read/write, wait for rows that have an uncommitted record version (ie being modified by a concurrent transaction), which combined with `isc_tpb_nowait` means ‘fail immediately when reading/updating a row with an uncommitted version’), and don’t wait for locks (ie fail when you can’t get a lock immediately).

Firebird was forked from InterBase about 18 years ago, and the OP wants to do the same for InterBase. I do not know if the InterBase JDBC driver has a similar configuration option.

---

<div class="post-metadata">

**Author:** ![blyons](https://avatars.discourse-cdn.com/v4/letter/b/8797f3/32.png) [@blyons](https://discourse.hibernate.org/u/blyons)\
**Post date:** [January 11, 2018, 3:41pm UTC](https://discourse.hibernate.org/t/setting-transaction-read-commited-on-interbase-configuration-properties-for-interbase-interclient-hibernate/47/6 "2018-01-11T15:41:05Z")

</div>

Gentlemen,

Thanks for the dialog on this subject. I did receive a reply overnight from someone in the Interbase Expert Group. Those parameters are changeable in JDBC via the following:

setTransactionIsolation(Connection.TRANSACTION\_READ\_COMMITTED);  
setLockResolution(Connection.LOCK\_RESOLUTION\_NO\_WAIT);  
setVersionAcknowledgement(Connection.IGNORE\_UNCOMMITTED\_RECORD\_VERSIONS\_ON\_READ);

But, as Vlad pointed out we’re currently using a default hibernate.connection package and cannot access the Connection object easily. I think what i’m going to do is to pick a Connection pool manager (probably Hikari) and then, since I have direct access to the Connection object I should be able to apply the Connection object settings listed above. My original problem was since our team was using the hibernate default connection pool we could not gain access to the underlying JDBC Connection object easily.
