I was using camunda spring boot starters in micro service running as process application.
Database version is AWS RDS - MySQL 5.7.17 (Innodb).
As per docs, and camunda workflows are tested in READ-COMMITTED isolation level which is recommended to set for camunda usecases.
But REPEATABLE-READ was default isolation level in MySQL.
So i was trying to set isolation level to READ-COMMITTED globally.
With superuser previleges, i executed below query to set recommended isolation level:
SET GLOBAL tx_isolation='READ-COMMITTED';
To check whether isolation level was set, executed below query,
Also executed below query and got different results:
How can i ensure that my application was running with READ_COMMITTED isolation level?
Yana
2
Hi,
I am not mysql expert, but I guess you need to set the session isolation explicitly:
SET SESSION tx_isolation='READ-COMMITTED'
not only the global configuration.
Thanks @Yana,
I tried this. It will set isolation for current session.
Whenever application connects to database, new session will be created, that will pointing to default Isolation level of MySQL(REPEATBALE READ).
I want to set it programmatically to all sessions.
1 Like
I was able to set ISOLATION LEVEL programmatically using apache commons dpc2 connection pooling.
BasicDataSource dataSource = new BasicDataSource();
dataSource.setPoolPreparedStatements(true);
dataSource.setMaxOpenPreparedStatements(20);
dataSource.setDefaultTransactionIsolation(2);
1 Like