Polishing
This commit is contained in:
parent
8158b6fd86
commit
f359c117d3
|
|
@ -87,11 +87,11 @@ public enum Propagation {
|
|||
|
||||
/**
|
||||
* Execute within a nested transaction if a current transaction exists,
|
||||
* behave like {@code REQUIRED} else. There is no analogous feature in EJB.
|
||||
* behave like {@code REQUIRED} otherwise. There is no analogous feature in EJB.
|
||||
* <p>Note: Actual creation of a nested transaction will only work on specific
|
||||
* transaction managers. Out of the box, this only applies to the JDBC
|
||||
* DataSourceTransactionManager when working on a JDBC 3.0 driver.
|
||||
* Some JTA providers might support nested transactions as well.
|
||||
* DataSourceTransactionManager. Some JTA providers might support nested
|
||||
* transactions as well.
|
||||
* @see org.springframework.jdbc.datasource.DataSourceTransactionManager
|
||||
*/
|
||||
NESTED(TransactionDefinition.PROPAGATION_NESTED);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -553,7 +553,7 @@ public abstract class AbstractPlatformTransactionManager implements PlatformTran
|
|||
if (definition.getTimeout() != TransactionDefinition.TIMEOUT_DEFAULT) {
|
||||
return definition.getTimeout();
|
||||
}
|
||||
return this.defaultTimeout;
|
||||
return getDefaultTimeout();
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1099,6 +1099,8 @@ public abstract class AbstractPlatformTransactionManager implements PlatformTran
|
|||
* @param definition a TransactionDefinition instance, describing propagation
|
||||
* behavior, isolation level, read-only flag, timeout, and transaction name
|
||||
* @throws TransactionException in case of creation or system errors
|
||||
* @throws org.springframework.transaction.NestedTransactionNotSupportedException
|
||||
* if the underlying transaction does not support nesting
|
||||
*/
|
||||
protected abstract void doBegin(Object transaction, TransactionDefinition definition)
|
||||
throws TransactionException;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -292,10 +292,11 @@ public abstract class TransactionSynchronizationManager {
|
|||
throws IllegalStateException {
|
||||
|
||||
Assert.notNull(synchronization, "TransactionSynchronization must not be null");
|
||||
if (!isSynchronizationActive()) {
|
||||
Set<TransactionSynchronization> synchs = synchronizations.get();
|
||||
if (synchs == null) {
|
||||
throw new IllegalStateException("Transaction synchronization is not active");
|
||||
}
|
||||
synchronizations.get().add(synchronization);
|
||||
synchs.add(synchronization);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue