ACS-1033 : Spring upgrade to 5.3.2 (#213)

- Update test as per 5de549d7d4
- before spring 5.3.0, AbstractFallbackSQLExceptionTranslator was translating org.postgresql.util.PSQLException as UncategorizedSQLException - now it returns null (ref. e9cded560d (diff-c6aa1c6a4b11e8a722808e945c4c5b6ef471c42871c7ce830554dde81ad7f2c2L89))

Co-authored-by: CezarLeahu <35226487+CezarLeahu@users.noreply.github.com>
This commit is contained in:
Denis Ungureanu
2020-12-23 12:21:03 +02:00
committed by GitHub
parent a79f782a91
commit f786f4ffaf
4 changed files with 23 additions and 11 deletions

View File

@@ -19,6 +19,8 @@
package org.alfresco.util.transaction;
import java.lang.reflect.Method;
import java.util.Collection;
import java.util.Collections;
import javax.transaction.HeuristicMixedException;
import javax.transaction.HeuristicRollbackException;
@@ -135,6 +137,8 @@ public class SpringAwareUserTransaction
private long threadId = Long.MIN_VALUE;
/** make sure that we clean up the thread transaction stack properly */
private boolean finalized = false;
private Collection<String> labels = Collections.emptyList();
/**
* Creates a user transaction that defaults to {@link TransactionDefinition#PROPAGATION_REQUIRED}.
@@ -200,6 +204,21 @@ public class SpringAwareUserTransaction
return null;
}
/**
* Associate one or more labels with this transaction attribute.
* <p>This may be used for applying specific transactional behavior
* or follow a purely descriptive nature.
*/
public void setLabels(Collection<String> labels) {
this.labels = labels;
}
@Override
public Collection<String> getLabels()
{
return this.labels;
}
/**
* The {@link UserTransaction } must rollback regardless of the error. The
* {@link #rollback() rollback} behaviour is implemented by simulating a caught