You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by fa...@apache.org on 2010/04/10 00:48:35 UTC

svn commit: r932643 - in /openjpa/trunk/openjpa-jdbc/src/main: java/org/apache/openjpa/jdbc/sql/InformixDictionary.java resources/org/apache/openjpa/jdbc/sql/localizer.properties

Author: faywang
Date: Fri Apr  9 22:48:35 2010
New Revision: 932643

URL: http://svn.apache.org/viewvc?rev=932643&view=rev
Log:
OPENJPA-1608: the RetainUpdateLock is not supported for IDS 11.10

Modified:
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/InformixDictionary.java
    openjpa/trunk/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/localizer.properties

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/InformixDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/InformixDictionary.java?rev=932643&r1=932642&r2=932643&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/InformixDictionary.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/InformixDictionary.java Fri Apr  9 22:48:35 2010
@@ -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 {

Modified: openjpa/trunk/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/localizer.properties
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/localizer.properties?rev=932643&r1=932642&r2=932643&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/localizer.properties (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/localizer.properties Fri Apr  9 22:48:35 2010
@@ -207,3 +207,4 @@ unknown-delim-support: Unable to determi
 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}.
\ No newline at end of file