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