Search code examples
javapostgresqltransactionsjava-ee-5

How to set the transaction isolation level of a Postgres Datasource


How do I set the global transaction isolation level for a postgres data source.

I'm running on jboss and I'm using hibernate to connect.

I know that I can set the isolation level from hibernate, does this work for Postgres?

This would be by setting the hibernate.connection.isolation hibernate property to 1,2,4,8 - the various values of the relevant static fields.

I'm using the org.postgresql.xa.PGXADataSource


Solution

  • You can set isolation level that way. Hibernate allows you to do it in a database-agnostic way, so it'll work with PostgreSQL.