提交 947b582b authored 作者: Noel Grandin's avatar Noel Grandin

inline MVTable.getTransaction(Session)

上级 31372bc0
......@@ -246,7 +246,7 @@ public class MVPrimaryIndex extends BaseIndex {
public void remove(Session session) {
TransactionMap<Value, Value> map = getMap(session);
if (!map.isClosed()) {
Transaction t = mvTable.getTransaction(session);
Transaction t = session.getTransaction();
t.removeMap(map);
}
}
......@@ -374,7 +374,7 @@ public class MVPrimaryIndex extends BaseIndex {
if (session == null) {
return dataMap;
}
Transaction t = mvTable.getTransaction(session);
Transaction t = session.getTransaction();
return dataMap.getInstance(t, Long.MAX_VALUE);
}
......
......@@ -367,7 +367,7 @@ public class MVSecondaryIndex extends BaseIndex implements MVIndex {
public void remove(Session session) {
TransactionMap<Value, Value> map = getMap(session);
if (!map.isClosed()) {
Transaction t = mvTable.getTransaction(session);
Transaction t = session.getTransaction();
t.removeMap(map);
}
}
......@@ -459,7 +459,7 @@ public class MVSecondaryIndex extends BaseIndex implements MVIndex {
if (session == null) {
return dataMap;
}
Transaction t = mvTable.getTransaction(session);
Transaction t = session.getTransaction();
return dataMap.getInstance(t, Long.MAX_VALUE);
}
......
......@@ -260,7 +260,7 @@ public class MVSpatialIndex extends BaseIndex implements SpatialIndex, MVIndex {
public void remove(Session session) {
TransactionMap<SpatialKey, Value> map = getMap(session);
if (!map.isClosed()) {
Transaction t = mvTable.getTransaction(session);
Transaction t = session.getTransaction();
t.removeMap(map);
}
}
......@@ -330,7 +330,7 @@ public class MVSpatialIndex extends BaseIndex implements SpatialIndex, MVIndex {
if (session == null) {
return dataMap;
}
Transaction t = mvTable.getTransaction(session);
Transaction t = session.getTransaction();
return dataMap.getInstance(t, Long.MAX_VALUE);
}
......
......@@ -670,7 +670,7 @@ public class MVTable extends TableBase {
@Override
public void removeRow(Session session, Row row) {
lastModificationId = database.getNextModificationDataId();
Transaction t = getTransaction(session);
Transaction t = session.getTransaction();
long savepoint = t.setSavepoint();
try {
for (int i = indexes.size() - 1; i >= 0; i--) {
......@@ -697,7 +697,7 @@ public class MVTable extends TableBase {
@Override
public void addRow(Session session, Row row) {
lastModificationId = database.getNextModificationDataId();
Transaction t = getTransaction(session);
Transaction t = session.getTransaction();
long savepoint = t.setSavepoint();
try {
for (int i = 0, size = indexes.size(); i < size; i++) {
......@@ -855,16 +855,6 @@ public class MVTable extends TableBase {
return transactionStore.begin();
}
/**
* Get the transaction to use for this session.
*
* @param session the session
* @return the transaction
*/
Transaction getTransaction(Session session) {
return session.getTransaction();
}
@Override
public Column getRowIdColumn() {
if (rowIdColumn == null) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论