#2887 - Fix for Setting isolation level disables query cache

Use getInternalConnection() in order to set the queryOnly = false flag
which is done via connection()
This commit is contained in:
Rob Bygrave committed 2022-11-10 12:32:23 +13:00
1 parent 0fd2f34ed0
commit 6e9a8704b4
2 files changed
+2 -2

No files matched your search

@@ -396,7 +396,7 @@ final class CQueryBuilder {
sql = nativeQueryPaging(query, sql);
}
query.setGeneratedSql(sql);
Connection connection = request.transaction().connection();
Connection connection = request.transaction().getInternalConnection();
BeanDescriptor<?> desc = request.descriptor();
try {
// For SqlServer we need either "selectMethod=cursor" in the connection string or fetch explicitly a cursorable
@@ -35,7 +35,7 @@ abstract class TransactionFactory {
*/
final SpiTransaction setIsolationLevel(SpiTransaction t, boolean explicit, int isolationLevel) {
if (isolationLevel > -1) {
Connection connection = t.connection();
Connection connection = t.getInternalConnection();
try {
connection.setTransactionIsolation(isolationLevel);
} catch (SQLException e) {