mirror of https://github.com/apache/openjpa.git
OPENJPA-203. Fix select-for-update queries to timeout after the LockTimeout interval
git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@526059 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
57442b7059
commit
c5d82a70d5
|
@ -339,6 +339,9 @@ public class SelectImpl
|
||||||
stmnt = sql.prepareStatement(conn, fetch, rsType, -1);
|
stmnt = sql.prepareStatement(conn, fetch, rsType, -1);
|
||||||
else
|
else
|
||||||
stmnt = sql.prepareStatement(conn, rsType, -1);
|
stmnt = sql.prepareStatement(conn, rsType, -1);
|
||||||
|
|
||||||
|
if (forUpdate)
|
||||||
|
stmnt.setQueryTimeout(fetch.getLockTimeout() / 1000);
|
||||||
rs = stmnt.executeQuery();
|
rs = stmnt.executeQuery();
|
||||||
} catch (SQLException se) {
|
} catch (SQLException se) {
|
||||||
// clean up statement
|
// clean up statement
|
||||||
|
|
Loading…
Reference in New Issue