[Minor] Moved finally block in AbstractTransaction to .close()
This commit is contained in:
parent
ea983d1113
commit
1e114c1ab2
|
@ -107,6 +107,7 @@ public abstract class AbstractTransaction implements StrolchTransaction {
|
||||||
this.txResult.setState(TransactionState.OPEN);
|
this.txResult.setState(TransactionState.OPEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getAction() {
|
public String getAction() {
|
||||||
return this.action;
|
return this.action;
|
||||||
}
|
}
|
||||||
|
@ -125,8 +126,6 @@ public abstract class AbstractTransaction implements StrolchTransaction {
|
||||||
return this.txResult.getState().isOpen();
|
return this.txResult.getState().isOpen();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isRollingBack() {
|
public boolean isRollingBack() {
|
||||||
return this.txResult.getState().isRollingBack();
|
return this.txResult.getState().isRollingBack();
|
||||||
|
@ -193,11 +192,6 @@ public abstract class AbstractTransaction implements StrolchTransaction {
|
||||||
this.closeStrategy = closeStrategy;
|
this.closeStrategy = closeStrategy;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void close() throws StrolchTransactionException {
|
|
||||||
this.closeStrategy.close(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public StrolchTransaction readOnly() {
|
public StrolchTransaction readOnly() {
|
||||||
setCloseStrategy(TransactionCloseStrategy.READ_ONLY);
|
setCloseStrategy(TransactionCloseStrategy.READ_ONLY);
|
||||||
|
@ -317,11 +311,13 @@ public abstract class AbstractTransaction implements StrolchTransaction {
|
||||||
add(command);
|
add(command);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void add(Command command) {
|
public void add(Command command) {
|
||||||
assertNotReadOnly();
|
assertNotReadOnly();
|
||||||
this.commands.add(command);
|
this.commands.add(command);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isReadOnly() {
|
public boolean isReadOnly() {
|
||||||
return this.closeStrategy.isReadonly();
|
return this.closeStrategy.isReadonly();
|
||||||
}
|
}
|
||||||
|
@ -1572,10 +1568,6 @@ public abstract class AbstractTransaction implements StrolchTransaction {
|
||||||
this.txResult.setState(TransactionState.FAILED);
|
this.txResult.setState(TransactionState.FAILED);
|
||||||
|
|
||||||
handleFailure(true, start, e);
|
handleFailure(true, start, e);
|
||||||
|
|
||||||
} finally {
|
|
||||||
releaseElementLocks();
|
|
||||||
TransactionThreadLocal.removeTx();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1592,9 +1584,6 @@ public abstract class AbstractTransaction implements StrolchTransaction {
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
handleFailure(true, start, e);
|
handleFailure(true, start, e);
|
||||||
this.txResult.setState(TransactionState.FAILED);
|
this.txResult.setState(TransactionState.FAILED);
|
||||||
} finally {
|
|
||||||
releaseElementLocks();
|
|
||||||
TransactionThreadLocal.removeTx();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1636,6 +1625,13 @@ public abstract class AbstractTransaction implements StrolchTransaction {
|
||||||
}
|
}
|
||||||
handleFailure(true, start, e);
|
handleFailure(true, start, e);
|
||||||
this.txResult.setState(TransactionState.FAILED);
|
this.txResult.setState(TransactionState.FAILED);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void close() throws StrolchTransactionException {
|
||||||
|
try {
|
||||||
|
this.closeStrategy.close(this);
|
||||||
} finally {
|
} finally {
|
||||||
releaseElementLocks();
|
releaseElementLocks();
|
||||||
TransactionThreadLocal.removeTx();
|
TransactionThreadLocal.removeTx();
|
||||||
|
|
Loading…
Reference in New Issue