[Minor] Throw exception if forget to commit

This commit is contained in:
Robert von Burg 2017-09-08 18:48:53 +02:00
parent e128d42365
commit 97a0c076a4
1 changed files with 7 additions and 1 deletions

View File

@ -928,7 +928,13 @@ public abstract class AbstractTransaction implements StrolchTransaction {
if (!this.commands.isEmpty()) {
autoCloseableRollback();
String msg = "There are commands registered on a read-only transaction. Changing to rollback! Probably due to an exception!";
String msg = "There are commands registered on a read-only transaction. Changing to rollback! Did you forget to commit?";
throw new IllegalStateException(msg);
}
if (!this.objectFilter.isEmpty()) {
autoCloseableRollback();
String msg = "There are modified objects registered on a read-only transaction. Changing to rollback! Did you forget to commit?";
throw new IllegalStateException(msg);
}