openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgras...@apache.org
Subject svn commit: r1672487 - /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/InformixDictionary.java
Date Thu, 09 Apr 2015 20:53:51 GMT
Author: jgrassel
Date: Thu Apr  9 20:53:51 2015
New Revision: 1672487

URL: http://svn.apache.org/r1672487
Log:
OPENJPA-2570: Allow an informix user the option to disable the RETAINUPDATELOCKS sql

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

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=1672487&r1=1672486&r2=1672487&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
Thu Apr  9 20:53:51 2015
@@ -324,19 +324,21 @@ public class InformixDictionary
 
         // if we haven't already done so, initialize the lock mode of the
         // connection
-        if (_seenConnections.add(conn)) {
-            if (lockModeEnabled) {
-                String sql = "SET LOCK MODE TO WAIT";
-                if (lockWaitSeconds > 0)
-                    sql = sql + " " + lockWaitSeconds;
-                execute(sql, conn, true);
+        synchronized(_seenConnections) {
+            if (_seenConnections.add(conn)) {
+                if (lockModeEnabled) {
+                    String sql = "SET LOCK MODE TO WAIT";
+                    if (lockWaitSeconds > 0)
+                        sql = sql + " " + lockWaitSeconds;
+                    execute(sql, conn, true);
+                }
+                
+                if (!disableRetainUpdateLocksSQL){
+                    String sql = "SET ENVIRONMENT RETAINUPDATELOCKS 'ALL'";
+                    execute(sql, conn, false);
+                }
             }
-            
-            if (!disableRetainUpdateLocksSQL){
-                String sql = "SET ENVIRONMENT RETAINUPDATELOCKS 'ALL'";
-                execute(sql, conn, false);
-            }
-        }
+        }       
 
         // the datadirect driver requires that we issue a rollback before using
         // each connection



Mime
View raw message