[Major] Now throwing exception if TX is not committed but has commands
This commit is contained in:
parent
428b589d47
commit
f1216f8825
|
@ -723,12 +723,10 @@ public abstract class AbstractTransaction implements StrolchTransaction {
|
||||||
try {
|
try {
|
||||||
this.txResult.setState(TransactionState.CLOSING);
|
this.txResult.setState(TransactionState.CLOSING);
|
||||||
|
|
||||||
// TODO re-think this.
|
|
||||||
if (!this.commands.isEmpty()) {
|
if (!this.commands.isEmpty()) {
|
||||||
logger.error(
|
|
||||||
"There are commands registered on a read-only transaction. Changing to rollback! Probably due to an exception!");
|
|
||||||
autoCloseableRollback();
|
autoCloseableRollback();
|
||||||
return;
|
String msg = "There are commands registered on a read-only transaction. Changing to rollback! Probably due to an exception!";
|
||||||
|
throw new IllegalStateException(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
long auditTrailDuration = writeAuditTrail();
|
long auditTrailDuration = writeAuditTrail();
|
||||||
|
|
Loading…
Reference in New Issue