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


#1

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() );
}

#2

I created HHH-12749 for this.


#3

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