提交 05bb116e authored 作者: noelgrandin@gmail.com's avatar noelgrandin@gmail.com

change method name in CommandContainer, update() -> updateOrInsert(), to more…

change method name in CommandContainer, update() -> updateOrInsert(), to more accurately reflect it's purpose.
上级 bbba0f51
......@@ -97,7 +97,7 @@ public abstract class Command implements CommandInterface {
* @return the update count
* @throws DbException if the command is not an updating statement
*/
public int update() {
public int updateOrInsert() {
throw DbException.get(ErrorCode.METHOD_NOT_ALLOWED_FOR_QUERY);
}
......@@ -250,7 +250,7 @@ public abstract class Command implements CommandInterface {
while (true) {
database.checkPowerOff();
try {
return update();
return updateOrInsert();
} catch (DbException e) {
start = filterConcurrentUpdate(e, start);
} catch (OutOfMemoryError e) {
......
......@@ -69,7 +69,7 @@ class CommandContainer extends Command {
}
@Override
public int update() {
public int updateOrInsert() {
recompileIfRequired();
setProgress(DatabaseEventListener.STATE_STATEMENT_START);
start();
......
......@@ -33,12 +33,12 @@ class CommandList extends Command {
if (remainingCommand.isQuery()) {
remainingCommand.query(0);
} else {
remainingCommand.update();
remainingCommand.updateOrInsert();
}
}
@Override
public int update() {
public int updateOrInsert() {
int updateCount = command.executeUpdate();
executeRemaining();
return updateCount;
......
......@@ -831,6 +831,7 @@ public class Session extends SessionWithState {
public void setLastIdentity(Value last) {
this.lastIdentity = last;
this.lastScopeIdentity = last;
new Throwable("lastScopeIdentity=" + last).printStackTrace();
}
public Value getLastIdentity() {
......@@ -839,6 +840,7 @@ public class Session extends SessionWithState {
public void setLastScopeIdentity(Value last) {
this.lastScopeIdentity = last;
new Throwable("lastScopeIdentity=" + last).printStackTrace();
}
public Value getLastScopeIdentity() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论