Why same transaction isolation level value is being set at TransactionImpl.begin() for same transation

Why in C3P0ConnectionProvider.getConnection() every connection object setting the same isolation level value again for every transaction?

If Connection.getTransactionIsolation() is already set to READ COMMITTED then why it is again setting the same READ COMMITTED value to that connection object?

Because of that after enabling the SQL auditing this statement logging the unnecessary sql statement of “alter session set isolation_level = read committed”.

Is there any specific reason if not then Is possible to modify code like :

if ( isolation != null && c.getTransactionIsolation()!=isolation.intValue()  ) {
    c.setTransactionIsolation( isolation.intValue() );
}

I created HHH-12749 for this.

The issue is fixed and will be available from 5.2.18 and 5.3.2 onwards.

1 Like