From: Barry Lind Date: Mon, 11 Aug 2003 20:54:55 +0000 (+0000) Subject: Applied patch from Kim Ho to fix a regression against a 7.4 server. The result X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=97ba220b9b3005b48c312d13261dbfa863dc5e44;p=users%2Fbernd%2Fpostgres.git Applied patch from Kim Ho to fix a regression against a 7.4 server. The result of transaction isolation level changed from uppercase to lower case between 7.3 and 7.4. In testing, a regression was also fixed in this area when talking to a 7.2 server due to changes in how notice messages are processed in the current code. Modified Files: jdbc/build.xml jdbc/org/postgresql/core/BaseStatement.java jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java --- diff --git a/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java b/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java index 5db486c6a0..c4060c7924 100644 --- a/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java +++ b/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java @@ -1345,16 +1345,18 @@ public abstract class AbstractJdbc1Connection implements BaseConnection } rs.close(); } else { - clearWarnings(); - execSQL(sql); - SQLWarning warning = getWarnings(); + BaseResultSet l_rs = execSQL(sql); + BaseStatement l_stat = l_rs.getPGStatement(); + SQLWarning warning = l_stat.getWarnings(); if (warning != null) { level = warning.getMessage(); } - clearWarnings(); + l_rs.close(); + l_stat.close(); } if (level != null) { + level = level.toUpperCase(); if (level.indexOf("READ COMMITTED") != -1) return Connection.TRANSACTION_READ_COMMITTED; else if (level.indexOf("READ UNCOMMITTED") != -1)