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

inline MVTable.getTransaction(Session)

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