From 8ece757233957518b2cf30b67f7a9103acf4bced Mon Sep 17 00:00:00 2001 From: Patrick Linskey Date: Fri, 6 Apr 2007 16:08:27 +0000 Subject: [PATCH] OPENJPA-182 git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@526212 13f79535-47bb-0310-9956-ffa450edef68 --- .../openjpa/jdbc/kernel/JDBCFetchConfigurationImpl.java | 9 ++++++--- .../java/org/apache/openjpa/jdbc/sql/DBDictionary.java | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCFetchConfigurationImpl.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCFetchConfigurationImpl.java index 669888dde..cd81b363a 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCFetchConfigurationImpl.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCFetchConfigurationImpl.java @@ -327,7 +327,7 @@ public class JDBCFetchConfigurationImpl } public JDBCFetchConfiguration setIsolationLevel(int level) { - if (level != -1 + if (level != -1 && level != DEFAULT && level != Connection.TRANSACTION_NONE && level != Connection.TRANSACTION_READ_UNCOMMITTED && level != Connection.TRANSACTION_READ_COMMITTED @@ -335,8 +335,11 @@ public class JDBCFetchConfigurationImpl && level != Connection.TRANSACTION_SERIALIZABLE) throw new IllegalArgumentException( _loc.get("bad-level", Integer.valueOf(level)).getMessage()); - - _state.isolationLevel = level; + + if (level == DEFAULT) + _state.isolationLevel = -1; + else + _state.isolationLevel = level; return this; } } diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java index f7e38de92..237dc965d 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java @@ -2205,8 +2205,8 @@ public class DBDictionary if (forUpdate && !simulateLocking) { assertSupport(supportsSelectForUpdate, "SupportsSelectForUpdate"); - if (this.forUpdateClause != null) - buf.append(" ").append(this.forUpdateClause); + if (forUpdateClause != null) + buf.append(" ").append(forUpdateClause); } if (range && rangePosition == RANGE_POST_LOCK) appendSelectRange(buf, start, end);