提交 b730eb70 authored 作者: noelgrandin's avatar noelgrandin

rename the identity and scopeIdentity methods and fields to use the same naming convention

上级 b52ac445
......@@ -391,7 +391,7 @@ public class FunctionAlias extends SchemaObjectBase {
}
}
boolean old = session.getAutoCommit();
Value identity = session.getScopeIdentity();
Value identity = session.getLastScopeIdentity();
boolean defaultConnection = session.getDatabase().getSettings().defaultConnection;
try {
session.setAutoCommit(false);
......@@ -422,7 +422,7 @@ public class FunctionAlias extends SchemaObjectBase {
Value ret = DataType.convertToValue(session, returnValue, dataType);
return ret.convertTo(dataType);
} finally {
session.setScopeIdentity(identity);
session.setLastScopeIdentity(identity);
session.setAutoCommit(old);
if (defaultConnection) {
Driver.setDefaultConnection(null);
......
......@@ -67,7 +67,7 @@ public class Session extends SessionWithState {
private Random random;
private int lockTimeout;
private Value lastIdentity = ValueLong.get(0);
private Value scopeIdentity = ValueLong.get(0);
private Value lastScopeIdentity = ValueLong.get(0);
private int firstUncommittedLog = Session.LOG_WRITTEN;
private int firstUncommittedPos = Session.LOG_WRITTEN;
private HashMap<String, Integer> savepoints;
......@@ -707,7 +707,7 @@ public class Session extends SessionWithState {
}
public void setLastIdentity(Value last) {
this.scopeIdentity = last;
this.lastScopeIdentity = last;
this.lastIdentity = last;
}
......@@ -715,12 +715,12 @@ public class Session extends SessionWithState {
return lastIdentity;
}
public void setScopeIdentity(Value scopeIdentity) {
this.scopeIdentity = scopeIdentity;
public void setLastScopeIdentity(Value last) {
this.lastScopeIdentity = last;
}
public Value getScopeIdentity() {
return scopeIdentity;
public Value getLastScopeIdentity() {
return lastScopeIdentity;
}
/**
......
......@@ -722,7 +722,7 @@ public class Function extends Expression implements FunctionCall {
result = session.getLastIdentity();
break;
case SCOPE_IDENTITY:
result = session.getScopeIdentity();
result = session.getLastScopeIdentity();
break;
case AUTOCOMMIT:
result = ValueBoolean.get(session.getAutoCommit());
......
......@@ -115,14 +115,14 @@ public class TriggerObject extends SchemaObjectBase {
if (type != Trigger.SELECT) {
old = session.setCommitOrRollbackDisabled(true);
}
Value identity = session.getScopeIdentity();
Value identity = session.getLastScopeIdentity();
try {
triggerCallback.fire(c2, null, null);
} catch (Throwable e) {
throw DbException.get(ErrorCode.ERROR_EXECUTING_TRIGGER_3, e, getName(),
triggerClassName, e.toString());
} finally {
session.setScopeIdentity(identity);
session.setLastScopeIdentity(identity);
if (type != Trigger.SELECT) {
session.setCommitOrRollbackDisabled(old);
}
......@@ -196,7 +196,7 @@ public class TriggerObject extends SchemaObjectBase {
Connection c2 = session.createConnection(false);
boolean old = session.getAutoCommit();
boolean oldDisabled = session.setCommitOrRollbackDisabled(true);
Value identity = session.getScopeIdentity();
Value identity = session.getLastScopeIdentity();
try {
session.setAutoCommit(false);
triggerCallback.fire(c2, oldList, newList);
......@@ -216,7 +216,7 @@ public class TriggerObject extends SchemaObjectBase {
throw DbException.convert(e);
}
} finally {
session.setScopeIdentity(identity);
session.setLastScopeIdentity(identity);
session.setCommitOrRollbackDisabled(oldDisabled);
session.setAutoCommit(old);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论