openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ss...@apache.org
Subject svn commit: r526059 - /incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java
Date Fri, 06 Apr 2007 05:21:35 GMT
Author: ssegu
Date: Thu Apr  5 22:21:35 2007
New Revision: 526059

URL: http://svn.apache.org/viewvc?view=rev&rev=526059
Log:
OPENJPA-203. Fix select-for-update queries to timeout after the LockTimeout interval

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

Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java?view=diff&rev=526059&r1=526058&r2=526059
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java
(original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java
Thu Apr  5 22:21:35 2007
@@ -339,6 +339,9 @@
                 stmnt = sql.prepareStatement(conn, fetch, rsType, -1);
             else
                 stmnt = sql.prepareStatement(conn, rsType, -1);
+
+            if (forUpdate)
+                stmnt.setQueryTimeout(fetch.getLockTimeout() / 1000);
             rs = stmnt.executeQuery();
         } catch (SQLException se) {
             // clean up statement



Mime
View raw message