throw tx exception if NOT_SUPPORTED is used with an active tx

This commit is contained in:
2024-09-12 09:48:28 -04:00
parent 580a9bda0b
commit a9cb101ff6

View File

@@ -136,8 +136,14 @@ public class RetryingTransactionAspect {
if (txl.isReadOnly())
throw new IllegalTransactionStateException("A read/write transaction exists where a read-only one is mandatory");
}
case NOT_SUPPORTED:
switch (AlfrescoTransactionSupport.getTransactionReadState()) {
case TXN_NONE:
return false;
default:
throw new IllegalTransactionStateException("A transaction exists and pausing it is not supported");
}
case SUPPORTS:
//case NOT_SUPPORTED: not supported; we would have to create another thread to simulate
return false;
case REQUIRED:
switch (AlfrescoTransactionSupport.getTransactionReadState()) {