java.sql.Connection.TRANSACTION_REPEATABLE_READ
равно 4.
Поддержка REPEATABLE READ
была введена в commit 67ee14e879d 13 января 2004 года, если я не ошибаюсь:
else
{
- isolationLevelSQL = "SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL ";
- switch (isolationLevel)
- {
- case Connection.TRANSACTION_READ_COMMITTED:
- isolationLevelSQL += "READ COMMITTED";
- break;
- case Connection.TRANSACTION_SERIALIZABLE:
- isolationLevelSQL += "SERIALIZABLE";
- break;
- default:
- throw new PSQLException("postgresql.con.isolevel", PSQLState.TRANSACTION_STATE_INVALID,
- new Integer(isolationLevel));
- }
+ isolationLevelSQL = "SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL " + getIsolationLevelName(level);
}
execSQL(isolationLevelSQL);
+ isolationLevel = level;
+ }
+
+ protected String getIsolationLevelName(int level) throws SQLException
+ {
+ boolean pg75 = haveMinimumServerVersion("7.5");
+
+ if (level == Connection.TRANSACTION_READ_COMMITTED) {
+ return " READ COMMITTED";
+ } else if (level == Connection.TRANSACTION_SERIALIZABLE) {
+ return " SERIALIZABLE";
+ } else if (pg75 && level == Connection.TRANSACTION_READ_UNCOMMITTED) {
+ return " READ UNCOMMITTED";
+ } else if (pg75 && level == Connection.TRANSACTION_REPEATABLE_READ) {
+ return " REPEATABLE READ";
+ }
+ throw new PSQLException("postgresql.con.isolevel", PSQLState.TRANSACTION_STATE_INVALID, new Integer(level));
}
Поэтому я предполагаю, что вы случайно используете какой-то очень старый драйвер JDBC.