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:
Srinivasa Segu 2007-04-06 05:21:35 +00:00
parent 57442b7059
commit c5d82a70d5
1 changed files with 3 additions and 0 deletions

View File

@ -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