I cannot figure out how to specify default transaction isolation level in Grails application . Please help and point where my mistake is. Following are the details.
Grails: 1.3.7
Database: Sql Server 2008.
DataSource.groovy:
dataSource {
...
driverClassName = "net.sourceforge.jtds.jdbc.Driver"
dialect = org.hibernate.dialect.SQLServerDialect
defaultTransactionIsolation = java.sql.Connection.TRANSACTION_READ_UNCOMMITTED
}
hibernate {
...
connection.isolation = java.sql.Connection.TRANSACTION_READ_UNCOMMITTED
}
Then I'm navigating through the application and execute the following query at the same time:
SELECT session_id, host_name, program_name, login_name, status, transaction_isolation_level
FROM sys.dm_exec_sessions
WHERE host_name IS NOT NULL AND login_name = 'cm'
ORDER BY host_name, program_name
that returns:
session_id host_name program_name login_name status transaction_isolation_level
61 ANDREYK-WS jTDS cm running 2
2 means READ_COMMITTED. I expect to see 1, i.e. READ_UNCOMMITTED.
If I explicitly specify: @Transactional(isolation=Isolation.READ_UNCOMMITTED)
The query above returns 1 as expected. However I do not want to attribute all the services in my application. What am I missing?