From 3736c1bc0659e7f9951d411d91c2f525c201dae9 Mon Sep 17 00:00:00 2001 From: Donald Woods Date: Sat, 10 Apr 2010 01:52:35 +0000 Subject: [PATCH] OPENJPA-1608: the RetainUpdateLock is not supported for IDS 11.10. Other parts of 1608 were already merged in. Merging in from trunk r932643 by Fay. git-svn-id: https://svn.apache.org/repos/asf/openjpa/branches/2.0.x@932660 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/openjpa/jdbc/sql/InformixDictionary.java | 13 +++++++++---- .../apache/openjpa/jdbc/sql/localizer.properties | 2 ++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/InformixDictionary.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/InformixDictionary.java index e7d2ee79d..c7028113c 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/InformixDictionary.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/InformixDictionary.java @@ -321,10 +321,10 @@ public class InformixDictionary String sql = "SET LOCK MODE TO WAIT"; if (lockWaitSeconds > 0) sql = sql + " " + lockWaitSeconds; - execute(sql, conn); + execute(sql, conn, true); } String sql = "SET ENVIRONMENT RETAINUPDATELOCKS 'ALL'"; - execute(sql, conn); + execute(sql, conn, false); } // the datadirect driver requires that we issue a rollback before using @@ -337,13 +337,18 @@ public class InformixDictionary return conn; } - private void execute(String sql, Connection conn) { + private void execute(String sql, Connection conn, boolean throwExc) { Statement stmnt = null; try { stmnt = conn.createStatement(); stmnt.executeUpdate(sql); } catch (SQLException se) { - throw SQLExceptions.getStore(se, this); + if (throwExc) + throw SQLExceptions.getStore(se, this); + else { + if (log.isTraceEnabled()) + log.trace(_loc.get("can-not-execute", sql)); + } } finally { if (stmnt != null) try { diff --git a/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/localizer.properties b/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/localizer.properties index de0ace73d..1a14a60b3 100644 --- a/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/localizer.properties +++ b/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/localizer.properties @@ -207,3 +207,5 @@ unknown-delim-support: Unable to determine whether delimited identifiers are sup can_not_get_current_schema: Unable to get current schema. SQLException message is "{0}". cannot-determine-identifier-base-case: Unable to determine the case to use for \ identifiers. The default value of "{0}" will be used. +can-not-execute: Unable to execute {0}. +