0

I am trying to set the default isolation level for a grails app.

In my conf/app/hibernate/hibernate.cfg.xml I have this specified:

<session-factory>
<property name="hibernate.connection.isolation">4</property>
<property name="connection.isolation">4</property>
</session-factory>

Unfortunately, when I check the actual connection isolation from the datasource, its still read_committed (2).

Is this just not supported in Grails 1.3.X?

Am I missing something else?

Yes, I know I specified it twice, the doc is a touch unclear and there are extant examples of both forms being used...

Thanks, -Clark,

Clark Wright
  • 741
  • 1
  • 6
  • 13

1 Answers1

0

To save people the hassle of actually following a link:

In DataSource.groovy, add

properties {
    defaultTransactionIsolation = java.sql.Connection.TRANSACTION_READ_UNCOMMITTED
  }

to your dataSource element, and make sure that pooled=true:

dataSource {
pooled = true
driverClassName = "com.ibm.db2.jcc.DB2Driver"
dialect = 'org.hibernate.dialect.DB2Dialect'
logSql = false
properties {
    defaultTransactionIsolation = java.sql.Connection.TRANSACTION_READ_UNCOMMITTED
  } 
}
Clark Wright
  • 741
  • 1
  • 6
  • 13