提交 987e59d7 authored 作者: Sergi Vladykin's avatar Sergi Vladykin

Minor code cleanup

上级 681c8540
......@@ -102,14 +102,16 @@ public class JdbcPreparedStatement extends JdbcStatement implements
synchronized (session) {
checkClosed();
closeOldResultSet();
ResultInterface result = null;
ResultInterface result;
boolean lazy = false;
boolean scrollable = resultSetType != ResultSet.TYPE_FORWARD_ONLY;
boolean updatable = resultSetConcurrency == ResultSet.CONCUR_UPDATABLE;
try {
setExecutingStatement(command);
result = command.executeQuery(maxRows, scrollable);
lazy = result.isLazy();
} finally {
if (result == null || !result.isLazy()) {
if (!lazy) {
setExecutingStatement(null);
}
}
......
......@@ -72,18 +72,20 @@ public class JdbcStatement extends TraceObject implements Statement, JdbcStateme
closeOldResultSet();
sql = JdbcConnection.translateSQL(sql, escapeProcessing);
CommandInterface command = conn.prepareCommand(sql, fetchSize);
ResultInterface result = null;
ResultInterface result;
boolean lazy = false;
boolean scrollable = resultSetType != ResultSet.TYPE_FORWARD_ONLY;
boolean updatable = resultSetConcurrency == ResultSet.CONCUR_UPDATABLE;
setExecutingStatement(command);
try {
result = command.executeQuery(maxRows, scrollable);
lazy = result.isLazy();
} finally {
if (result == null || !result.isLazy()) {
if (!lazy) {
setExecutingStatement(null);
}
}
if (!result.isLazy()) {
if (!lazy) {
command.close();
}
resultSet = new JdbcResultSet(conn, this, command, result, id,
......
......@@ -957,11 +957,13 @@ public final class JoinBatch {
}
viewIndex.setupQueryParameters(viewIndex.getSession(), first, last, null);
JoinBatch.this.viewTopFutureCursor = topFutureCursor;
ResultInterface localResult = null;
ResultInterface localResult;
boolean lazy = false;
try {
localResult = viewIndex.getQuery().query(0);
lazy = localResult.isLazy();
} finally {
if (localResult == null || !localResult.isLazy()) {
if (!lazy) {
resetViewTopFutureCursorAfterQuery();
}
}
......@@ -1094,11 +1096,13 @@ public final class JoinBatch {
assert topFutureCursors[i] != null;
joinBatches.get(i).viewTopFutureCursor = topFutureCursors[i];
}
ResultInterface localResult = null;
ResultInterface localResult;
boolean lazy = false;
try {
localResult = viewIndex.getQuery().query(0);
lazy = localResult.isLazy();
} finally {
if (localResult == null || !localResult.isLazy()) {
if (!lazy) {
resetViewTopFutureCursorAfterQuery();
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论