How to set transaction isolation level for Postgres data source

How to set global transaction isolation level for postgres data source.

I run jboss and I use hibernate to connect.

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

That would be by setting the hibernate hibernate.connection.isolation property to 1,2,4,8 - different values โ€‹โ€‹of the corresponding static fields.

I am using org.postgresql.xa.PGXADataSource

+3
source share
2 answers

. Hibernate , PostgreSQL.

+1

Hibernate , JBoss <transaction-isolation>:

<datasources>
  <local-tx-datasource>
    <jndi-name>GenericDS</jndi-name>
    <connection-url>[jdbc: url for use with Driver class]</connection-url>
    <driver-class>[fully qualified class name of java.sql.Driver implementation]</driver-class>
    <user-name>x</user-name>
    <password>y</password>
    <!-- you can include connection properties that will get passed in 
     the DriverManager.getConnection(props) call-->
    <!-- look at your Driver docs to see what these might be -->
    <connection-property name="char.encoding">UTF-8</connection-property>
    <transaction-isolation>TRANSACTION_SERIALIZABLE</transaction-isolation>
    [...]

JBoss wiki

+4

Source: https://habr.com/ru/post/1748859/


All Articles