Commit Graph

615 Commits

Author SHA1 Message Date
Sébastien Deleuze 50240bb609 Add runtime hints for tx management
Closes gh-28688
2022-07-01 14:54:08 +02:00
Sam Brannen ee209de9cf Merge branch '5.3.x'
# Conflicts:
#	spring-beans/src/test/java/org/springframework/beans/factory/support/security/CallbacksSecurityTests.java
#	spring-context/src/test/java/org/springframework/ejb/access/LocalSlsbInvokerInterceptorTests.java
#	spring-context/src/test/java/org/springframework/ejb/access/SimpleRemoteSlsbInvokerInterceptorTests.java
#	spring-web/src/test/java/org/springframework/remoting/jaxws/JaxWsSupportTests.java
#	spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/ViewResolutionIntegrationTests.java
2022-05-31 14:15:36 +02:00
Sam Brannen 1beb7068f6 Use new AssertJ exception assertions 2022-05-31 14:08:28 +02:00
Sam Brannen 720261db26 Use List.of() and Set.of() where feasible 2022-05-30 18:42:48 +02:00
Sam Brannen b570f60560 Merge branch '5.3.x'
# Conflicts:
#	spring-aop/src/main/java/org/springframework/aop/support/AopUtils.java
#	spring-aop/src/main/java/org/springframework/aop/support/annotation/AnnotationClassFilter.java
#	spring-aop/src/main/java/org/springframework/aop/support/annotation/AnnotationMatchingPointcut.java
#	spring-aop/src/main/java/org/springframework/aop/support/annotation/AnnotationMethodMatcher.java
#	spring-beans/src/main/java/org/springframework/beans/factory/annotation/RequiredAnnotationBeanPostProcessor.java
#	spring-context/src/main/java/org/springframework/context/annotation/CommonAnnotationBeanPostProcessor.java
#	spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedNotification.java
#	spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedOperationParameter.java
#	spring-core/src/main/java/org/springframework/javapoet/support/package-info.java
#	spring-core/src/main/java/org/springframework/util/TypeUtils.java
#	spring-web/src/main/java/org/springframework/http/HttpMethod.java
2022-03-18 16:47:12 +01:00
Sam Brannen 64b64d9ba0 Stop referring to features as "Java 5" features
With a Java 8 baseline in place for quite some time now, it no longer
makes sense to refer to features such as annotations as "Java 5
annotations".

This commit also removes old `Tiger*Tests` classes, thereby avoiding
duplicate execution of various tests.
2022-03-18 16:32:30 +01:00
Sam Brannen c1033dbfb3 Support type-safe transaction rollback rules
Prior to this commit, there was no way to configure type-safe rollback
rules for transactions.

Even though a rollback rule could be defined using a Class reference
via the `rollbackFor` and `noRollbackFor` attributes in @Transactional,
those Class references got converted to Strings (as the fully qualified
class names of the exception types) in RollbackRuleAttribute which then
applied a pattern-based matching algorithm as if the Class references
had been supplied as Strings/patterns to begin with, thereby losing the
type information.

Pattern-based rollback rules suffer from the following three categories
of unintentional matches.

- identically named exceptions in different packages when the pattern
  does not include the package name -- for example,
  example.client.WebException and example.server.WebException both
  match against a "WebException" pattern.

- similarly named exceptions in the same package when a given exception
  name starts with the name of another exception -- for example,
  example.BusinessException and example.BusinessExceptionWithDetails
  both match against an "example.BusinessException" pattern.

- nested exceptions when an exception type is declared in another
  exception -- for example, example.BusinessException and
  example.BusinessException$NestedException both match against an
  "example.BusinessException" pattern.

This commit prevents the latter two categories of unintentional matches
for rollback rules defined using a Class reference by storing the
exceptionType in RollbackRuleAttribute and using that type in the
implementation of RollbackRuleAttribute.getDepth(Class, int), resulting
in type-safe rollback rules whenever the `rollbackFor` and
`noRollbackFor` attributes in `@Transactional` are used.

Note that the first category of unintentional matches never applied to
rollback rules created from a Class reference since the fully qualified
name of a Class reference always includes the package name.

Closes gh-28098
2022-03-04 19:33:39 +01:00
Sam Brannen 9cb4783296 Merge branch '5.3.x'
# Conflicts:
#	spring-tx/src/main/java/org/springframework/transaction/annotation/Transactional.java
#	spring-tx/src/main/java/org/springframework/transaction/interceptor/RollbackRuleAttribute.java
2022-03-04 16:51:26 +01:00
Sam Brannen fa3130d716 Document that TX rollback rules may result in unintentional matches
Closes gh-28125
2022-03-04 16:39:11 +01:00
Sam Brannen b3e5f86277 Polish rollback rule support 2022-03-03 16:20:13 +01:00
Sam Brannen 68757073b0 Merge branch '5.3.x' 2022-03-02 17:29:26 +01:00
Sam Brannen 340f41af6d Suppress warnings in Gradle build 2022-03-02 17:28:45 +01:00
Sam Brannen 25aa295c2c Rename test class to adhere to conventions 2022-03-02 17:25:37 +01:00
Sam Brannen 14ae522172 Merge branch '5.3.x' 2022-03-01 19:10:54 +01:00
Sam Brannen 67b91b2390 Polish RollbackRuleTests
See gh-28098
2022-03-01 19:10:33 +01:00
Sam Brannen 8c6d59aaaf Polish contribution
See gh-28014
2022-02-19 14:43:26 +01:00
a.yazychyan c5c926726d Use enhanced switch expressions where feasible
Closes gh-28014
2022-02-19 14:34:05 +01:00
Juergen Hoeller a71a45e719 Deprecate AsyncTaskExecutor.execute(Runnable task, long startTimeout)
Closes gh-27959
2022-02-04 23:21:00 +01:00
Juergen Hoeller 9688e61e20 Upgrade to Groovy 4.0
Closes gh-27985
2022-02-04 21:01:02 +01:00
Sam Brannen d57bc176f2 Merge branch '5.3.x' 2022-01-10 14:21:25 +01:00
Sam Brannen df263d01b9 Use idiomatic AssertJ assertions for true, false, and null 2022-01-10 14:15:55 +01:00
Sam Brannen 61c3d7a989 Merge branch '5.3.x' 2022-01-04 14:09:02 +01:00
Sam Brannen 3e14cdbc69 Polish tests 2022-01-04 14:02:32 +01:00
Juergen Hoeller 9dc5c9f935 Merge branch '5.3.x'
# Conflicts:
#	build.gradle
2021-12-15 21:52:16 +01:00
Juergen Hoeller d665977787 Polishing 2021-12-15 21:50:30 +01:00
Juergen Hoeller 37bebeaaaf Accept protected @Transactional/Cacheable methods on CGLIB proxies
Closes gh-25582
2021-12-14 09:41:23 +01:00
Arjen Poutsma 81af7330f6 Deprecate StringUtils::trimWhitespace and variants
This commits deprecates
- StringUtils::trimWhitespace in favor of String::strip
- StringUtils::trimLeadingWhitespace in favor of String::stripLeading
- StringUtils::trimTrailingWhitespace in favor of String::stripTrailing

Closes gh-27769
2021-12-06 13:37:16 +01:00
Juergen Hoeller 7f43128a0e Merge branch '5.3.x'
# Conflicts:
#	build.gradle
#	spring-web/src/main/java/org/springframework/web/server/MediaTypeNotSupportedStatusException.java
#	spring-web/src/main/java/org/springframework/web/util/ContentCachingRequestWrapper.java
#	spring-webmvc/src/main/java/org/springframework/web/servlet/handler/HandlerMappingIntrospector.java
2021-12-03 22:42:05 +01:00
Juergen Hoeller 14f24f43d7 Polishing 2021-12-03 22:36:31 +01:00
Juergen Hoeller 4750a9430c Early removal of 5.x-deprecated code
Closes gh-27686
2021-11-18 09:18:06 +01:00
Juergen Hoeller 0e1ba7aae5 Merge branch '5.3.x'
# Conflicts:
#	build.gradle
#	spring-context/src/main/java/org/springframework/context/annotation/Lazy.java
2021-11-09 22:39:58 +01:00
Juergen Hoeller 8d735e6e60 Note on PersistenceExceptionTranslator sorting and non-singleton retrieval
Closes gh-26412
2021-11-09 22:30:44 +01:00
Sam Brannen e9cf645b86 Apply "instanceof pattern matching" in spring-tx
This commit also applies additional clean-up tasks such as the following.

- final fields

This has only been applied to `src/main/java`.
2021-10-14 22:18:01 +02:00
Sam Brannen 2d1e0d5e38 Merge branch '5.3.x' 2021-10-06 12:13:21 +02:00
Sam Brannen 41ae9632d1 Upgrade to Checkstyle 9.0 and spring-javaformat 0.0.29
This commit upgrades the Gradle build to use Checkstyle 9.0 and
spring-javaformat 0.0.29 (which internally uses Checkstyle 8.45.1).

Closes gh-27520
2021-10-06 12:11:19 +02:00
Rossen Stoyanchev c1856d24e2 Merge branch '5.3.x' into main 2021-10-05 14:52:45 +01:00
Rossen Stoyanchev 7b9848a352 Replace deprecated Reactor Context related methods 2021-10-05 14:33:52 +01:00
Sam Brannen 030ba52805 Merge branch '5.3.x' 2021-09-29 16:56:33 +02:00
Sam Brannen 96e4d3a530 Fail Gradle build for Javadoc warnings
In order to catch Javadoc errors in the build, we now enable the
`Xwerror` flag for the `javadoc` tool. In addition, we now use
`Xdoclint:syntax` instead of `Xdoclint:none` in order to validate
syntax within our Javadoc.

This commit fixes all resulting Javadoc errors and warnings.

This commit also upgrades to Undertow 2.2.12.Final and fixes the
artifact names for exclusions for the Servlet and annotations APIs.

The incorrect exclusion of the Servlet API resulted in the Servlet API
being on the classpath twice for the javadoc task, which resulted in the
following warnings in previous builds.

javadoc: warning - Multiple sources of package comments found for package "javax.servlet"
javadoc: warning - Multiple sources of package comments found for package "javax.servlet.http"
javadoc: warning - Multiple sources of package comments found for package "javax.servlet.descriptor"
javadoc: warning - Multiple sources of package comments found for package "javax.servlet.annotation"

Closes gh-27480
2021-09-29 14:02:37 +02:00
Sam Brannen 93efb20a53 Fix broken links in Javadoc
This commit removes several links that were broken due to the removal
of various APIs in 6.0.

See gh-27480
2021-09-28 13:34:33 +02:00
Juergen Hoeller d84ca2ba90 Jakarta EE 9 migration
Upgrades many dependency declarations; removes old EJB 2.x support and outdated Servlet-based integrations (Commons FileUpload, FreeMarker JSP support, Tiles).

Closes gh-22093
Closes gh-25354
Closes gh-26185
Closes gh-27423
See gh-27424
2021-09-17 09:14:07 +02:00
Phillip Webb 52b03e3326 Migrate CoroutinesUtils to Java
Migrate `CoroutinesUtils` from Kotlin code to Java and drop the
`kotlin-coroutines` module.

This update removes the need for Kotlin tooling IDE plugins to be
installed.

Closes gh-27379
2021-09-13 17:39:45 +02:00
Brian Clozel cecc0849a8 Upgrade to Gradle 7.2
This commit upgrades Gradle to 7.2.
Gradle configuration names are updated accordingly.
This also upgrades Gradle build plugins.

See gh-26870
2021-09-13 09:37:35 +02:00
Philippe Marschall debf61b948
Remove unused private loggers
Closes gh-27336
2021-08-30 16:51:59 +02:00
Juergen Hoeller a07c7865a5 Lazy initialization of transaction UUID (with deprecated getter methods)
Includes removal of trace logging for individual synchronization steps.

Closes gh-26955
2021-07-09 15:07:30 +02:00
Sam Brannen a2ef6badc4 Use StringBuilder.append(char) where possible
To slightly improve performance, this commit switches to
StringBuilder.append(char) instead of StringBuilder.append(String)
whenever we append a single character to a StringBuilder.

Closes gh-27098
2021-06-25 10:44:28 +02:00
Sam Brannen da9ee06e05 Improve @Transactional docs regarding method visibility
Closes gh-27003
2021-05-30 17:10:01 +02:00
Sam Brannen 1e1045ba42 Doc tx semantics for @TransactionalEventListener after completion phases
This commit improves the Javadoc regarding transactional semantics for
@TransactionalEventListener methods invoked in the AFTER_COMMIT,
AFTER_ROLLBACK, or AFTER_COMPLETION phase. Specifically, the
documentation now points out that interactions with the underlying
transactional resource will not be committed in those phases.

Closes gh-26974
2021-05-26 14:21:08 +02:00
Sébastien Deleuze 3dba3691a7 Upgrade to Coroutines 1.5.0
This commit upgrades to Coroutines 1.5.0 while retaining
Coroutines 1.4.x compatibility.

Closes gh-26897
2021-05-17 11:37:02 +02:00
Juergen Hoeller 7f670bbe68 TransactionSynchronization does not support @Order (just Ordered interface)
See gh-21725
2021-05-11 15:45:05 +02:00
Juergen Hoeller 3c9bd3177e Move getListenerId method to Smart/GenericApplicationListener
See gh-26638
2021-03-09 12:30:52 +01:00
Juergen Hoeller 86902d27b2 Expose id/getListenerId in base EventListener/ApplicationListener (pulled up from tx)
Includes removeApplicationListeners(Predicate) method in ApplicationEventMulticaster.

Closes gh-26638
2021-03-08 19:31:56 +01:00
Sam Brannen 3215880d08 Remove Javadoc link to private method 2021-02-21 19:13:02 +01:00
Sam Brannen 2d29fcd0bb Polish Javadoc for TransactionSynchronizationUtils 2021-01-27 14:03:38 +01:00
Sam Brannen 5e56162394 Fix Checkstyle violation
The @since tag must come before @see tags.

See gh-26450
2021-01-27 11:53:20 +01:00
Johnny Lim 45650f2b27
Add @since tag to TransactionSynchronizationUtils.unwrapResourceIfNecessary()
Closes gh-26450
2021-01-27 11:23:22 +01:00
Sam Brannen 4a7a2258f9 Unwrap proxied DataSources in SqlScriptsTestExecutionListener
Prior to this commit, if the DataSource in the
DataSourceFromTransactionManager was wrapped in a proxy implementing
InfrastructureProxy, SqlScriptsTestExecutionListener would throw an
exception stating that the DataSource in the ApplicationContext and the
DataSource in the DataSourceFromTransactionManager were not the same.

This commit unwraps both data sources and compares the underlying
target instances to check for equality.

In addition, this commit makes the unwrapResourceIfNecessary() method in
TransactionSynchronizationUtils public.

Closes gh-26422
2021-01-22 18:22:00 +01:00
Juergen Hoeller 2ee231dee2 Document that @Transactional does not propagate to new threads
Closes gh-25439
2020-11-17 14:43:17 +01:00
Juergen Hoeller 51b1306d70 Move coroutines invocation decision to invokeWithinTransaction
See gh-26092
2020-11-16 17:41:09 +01:00
Sébastien Deleuze 737d77a739 Fix @Transactional support on functions returning Flow
Closes gh-26052
2020-11-09 17:45:28 +01:00
Sébastien Deleuze 1f13516528 Fix @Transactional support on suspending function
With this commit, @Transactional on suspending functions
returning a value now commits the transaction properly.

Closes gh-25998
2020-11-09 17:43:31 +01:00
Sébastien Deleuze 32238cc996 Add CoroutinesAnnotationTransactionInterceptorTests
suspendingValueSuccess() currently fails due to an
unexpected rollback on transactional suspending functions
returning a value.

See gh-25998
2020-11-09 10:19:24 +01:00
Sébastien Deleuze d80dd50c9d Add CoroutinesAnnotationTransactionInterceptorTests
suspendingValueSuccess() currently fails due to an
unexpected rollback on transactional suspending functions
returning a value.

See gh-25998
2020-11-09 10:11:39 +01:00
Sébastien Deleuze bdf120f1ef Add CoroutinesAnnotationTransactionInterceptorTests
suspendingValueSuccess() currently fails due to an
unexpected rollback on transactional suspending functions
returning a value.

See gh-25998
2020-11-09 10:10:25 +01:00
Sébastien Deleuze e781d21097 Add CoroutinesAnnotationTransactionInterceptorTests
suspendingValueSuccess() currently fails due to an
unexpected rollback on transactional suspending functions
returning a value.

See gh-25998
2020-11-09 10:10:13 +01:00
Sébastien Deleuze 5170f3f594 Fix a Kotlin test compile warning 2020-10-27 09:41:59 +01:00
Juergen Hoeller 0aa3205e38 Fix nullability warnings 2020-10-26 22:19:26 +01:00
Sébastien Deleuze a2ff03074f Polishing 2020-10-26 09:57:30 +01:00
Sébastien Deleuze 5429c7afeb Support suspending functions annotated with @Transactional
This commit makes TransactionInterceptor and TransactionAspectSupport
Coroutines aware, adapting Reactive transaction support to Coroutines.

Suspending functions returning a Flow are handled like Flux, for other
return types, they are handled like Mono.

Closes gh-23575
2020-10-25 18:33:42 +01:00
Juergen Hoeller 95110d8257 Introduce TransactionalApplicationListener interface (with callback support)
Includes forPayload methods and common adapter classes for programmatic usage.
Aligns default order values for event handling delegates to LOWEST_PRECEDENCE.

Closes gh-24163
2020-10-22 15:19:32 +02:00
Сергей Цыпанов 8a04910bdd Drop explicit zeroing at instantiation of Atomic* objects 2020-10-06 15:45:12 +02:00
Juergen Hoeller f89bd47188 Merge branch '5.2.x' 2020-09-25 12:52:56 +02:00
Juergen Hoeller d022fcf32f Explicit note on TransactionalEventListener versus reactive transactions
Closes gh-25805
2020-09-25 12:49:45 +02:00
Sam Brannen d7fab85f51 Merge branch '5.2.x' 2020-09-25 11:17:24 +02:00
Sam Brannen f5d36aa47a Revert use of Map::computeIfAbsent in thread and tx scopes
Issues gh-25038 and gh-25618 collectively introduced a regression for
thread-scoped and transaction-scoped beans.

For example, given a thread-scoped bean X that depends on another
thread-scoped bean Y, if the names of the beans (when used as map keys)
end up in the same bucket within a ConcurrentHashMap AND an attempt is
made to retrieve bean X from the ApplicationContext prior to retrieving
bean Y, then the use of Map::computeIfAbsent in SimpleThreadScope
results in recursive access to the same internal bucket in the map.

On Java 8, that scenario simply hangs. On Java 9 and higher,
ConcurrentHashMap throws an IllegalStateException pointing out that a
"Recursive update" was attempted.

In light of these findings, we are reverting the changes made to
SimpleThreadScope and SimpleTransactionScope in commits 50a4fdac6e and
148dc95eb1.

Closes gh-25801
2020-09-25 11:00:06 +02:00
Сергей Цыпанов 1f3e52d932 gh-25650 Replace remaining usage of LinkedList with ArrayList in tests 2020-08-31 14:33:14 +02:00
Juergen Hoeller cf2e0c7959 Selected use of ArrayList instead of LinkedList in common places
See gh-25652
2020-08-27 14:14:44 +02:00
Juergen Hoeller 874574513c Replace remaining usage of LinkedList with ArrayList/ArrayDeque
Closes gh-25650
2020-08-26 18:32:08 +02:00
Sam Brannen 0f7ad1b5bf Merge branch '5.2.x' 2020-08-22 23:50:28 +02:00
Sam Brannen 148dc95eb1 Fix regressions in SimpleThreadScope and SimpleTransactionScope
PR gh-25038 introduced regressions in SimpleThreadScope and
SimpleTransactionScope in Spring Framework 5.2.7. Specifically, if a
thread-scoped or transaction-scoped bean has a dependency on another
thread-scoped or transaction-scoped bean, respectively, a
ConcurrentModificationException will be thrown on Java 11 or higher.

The reason is that Java 11 introduced a check for concurrent
modification in java.util.HashMap's computeIfAbsent() implementation,
and such a modification can occur when a thread-scoped bean is being
created in order to satisfy a dependency of another thread-scoped bean
that is currently being created.

This commit fixes these regressions by switching from HashMap to
ConcurrentHashMap for the instance maps in SimpleThreadScope and
SimpleTransactionScope.

Closes gh-25618
2020-08-22 23:19:58 +02:00
Juergen Hoeller 8dd285f877 Polishing 2020-08-07 13:02:43 +02:00
Juergen Hoeller 14839b1f4a Sort detected PersistenceExceptionTranslator beans
Closes gh-24644
2020-08-07 12:08:03 +02:00
Stephane Nicoll 673f83e388 Adapt to API changes in the latest reactor snapshot 2020-08-04 11:41:30 +02:00
Sam Brannen cdc234d7db Polish contribution
See gh-25446
2020-07-22 14:06:29 +02:00
XenoAmess c547809e89 Use instanceof instead of Class#isInstance where feasible
Closes gh-25446
2020-07-22 14:06:29 +02:00
XenoAmess 3b12beb1b8
Simplify if-statements with instanceof checks
Closes gh-25449
2020-07-22 10:34:27 +02:00
XenoAmess e71f702bb9
Use `static private` instead of `private static` for method declarations
Closes gh-25452
2020-07-21 18:26:28 +02:00
Juergen Hoeller 7e71749e34 Merge branch '5.2.x' 2020-06-23 23:26:52 +02:00
Juergen Hoeller b0cabb29f3 Polishing 2020-06-23 23:20:45 +02:00
Sam Brannen ab0e651547 Polish SerializationTestUtils, clean up warnings, etc. 2020-06-20 18:17:03 +02:00
Sam Brannen 9d5881e0ad Suppress warnings, remove unused code, etc. 2020-06-20 17:15:35 +02:00
Juergen Hoeller 3a653bd35f Deprecate JCA CCI support
Closes gh-25287
2020-06-19 19:19:14 +02:00
Sébastien Deleuze 6b355df903 Revert "Upgrade to Kotlin 1.4 M2"
This reverts commit 2a74eff10f.

Some regressions require to wait at least Kotlin 1.4 M3.
2020-06-18 14:06:39 +02:00
Juergen Hoeller 7f79a373c3 Merge branch '5.2.x'
# Conflicts:
#	build.gradle
2020-06-17 15:42:18 +02:00
Juergen Hoeller a08bf8c063 Avoid misleading log message for commit-triggering exception
Closes gh-25253
2020-06-17 15:39:41 +02:00
Mark Paluch 217b6e37a6 Rollback reactive transaction on cancel
This commit introduces a change in reactive transaction semantics for
cancel signals. Canceling a subscription now rolls back a reactive transaction
to achieve a deterministic transaction outcome.

Previously, cancel signals committed a transaction which could
cause partially committed transactions depending on when the cancel happened.
2020-06-17 15:04:54 +02:00
Juergen Hoeller 17cab9660c Deprecate TransactionSynchronizationAdapter
Closes gh-21725
2020-06-17 11:02:31 +02:00
Сергей Цыпанов 7949937655 Remove redundant assignment of default values to volatile fields 2020-06-17 10:50:51 +02:00
Sébastien Deleuze 2a74eff10f Upgrade to Kotlin 1.4 M2
- The compiler is configured to retain compatibility with Kotlin 1.3.
- Explicit API mode is not yet enabled but could be in the future.
- A workaround for Gradle build is required for now, see
  https://youtrack.jetbrains.com/issue/KT-39610 for more details.
- Some exceptions thrown by Kotlin have changed to NullPointerException,
  see https://youtrack.jetbrains.com/issue/KT-22275 for more details.

Closes gh-24171
2020-06-16 15:21:57 +02:00
Juergen Hoeller 663f2e8afd Merge branch '5.2.x' 2020-06-10 22:53:06 +02:00
Juergen Hoeller ae1ed9d458 Document exception handling limitations in TaskDecorator implementations
Closes gh-25231
2020-06-10 22:52:01 +02:00
Rossen Stoyanchev 150fe96a98 Merge branch '5.2.x' 2020-06-08 17:44:42 +01:00
Rossen Stoyanchev 9e1121fd8d Document behavior on reactive tx cancellation
Closes gh-25091
2020-06-08 17:43:52 +01:00
Juergen Hoeller e955e52f2f Refactor method name dispatching to switch statements
Closes gh-25163
2020-05-29 23:07:25 +02:00
Juergen Hoeller 42ff01b5aa Merge branch '5.2.x' 2020-05-29 15:57:32 +02:00
Juergen Hoeller cd4ef6f781 Consistently refer to FlushMode.MANUAL instead of outdated NEVER
Closes gh-25158
2020-05-29 15:51:54 +02:00
Juergen Hoeller 929244215c Merge branch '5.2.x'
# Conflicts:
#	build.gradle
2020-05-26 23:37:53 +02:00
Juergen Hoeller 1dea55dc20 WebSphereUowTransactionManager sets timeout for actual transaction only
Closes gh-25132
2020-05-26 23:34:36 +02:00
Juergen Hoeller 3c1ee64b7f Explicit nullability declarations for all AOP Alliance methods
Includes consistent declarations in AOP Alliance related Spring AOP code.

Closes gh-24117
2020-05-13 23:33:47 +02:00
Sam Brannen a16d178d72 Polish Javadoc for NameMatchTransactionAttributeSource 2020-05-13 13:29:07 +02:00
Juergen Hoeller dd0d0d51f6 Introduce resolvable timeout attribute on @Transactional and <tx:method>
Placeholders get resolved in timeoutString, qualifier and labels now.

Closes gh-25052
2020-05-12 21:55:22 +02:00
Sam Brannen 715e8c9ef6 Align TransactionManagementConfigurer support in TCF with production
This commit picks up where 613bd3be1d
left off by ensuring that a transaction manager configured via the
TransactionManagementConfigurer API takes precedence over any
transaction manager configured as a bean in the ApplicationContext
unless @Transactional is configured with a qualifier for the explicit
transaction manager to use in tests.

Closes gh-24869
2020-05-11 13:59:34 +02:00
Sam Brannen 65acda8d3e Polishing 2020-05-11 12:26:13 +02:00
Sam Brannen 3f30dcae80 Merge branch '5.2.x' 2020-05-10 15:44:57 +02:00
Yanming Zhou 50a4fdac6e
Use Map::computeIfAbsent to simplify scope implementations
Closes gh-25038
2020-05-10 15:41:00 +02:00
Sam Brannen 2dc9020f80 Merge branch '5.2.x' 2020-05-09 13:57:41 +02:00
Sam Brannen f5d011cb82 Filter reactive tx managers in TransactionAttributeSourceClassFilter
Prior to this commit, the TransactionAttributeSourceClassFilter
filtered out PlatformTransactionManager but not
ReactiveTransactionManager implementations.

TransactionAttributeSourceClassFilter now filters out any
TransactionManager implementation, covering both imperative and
reactive transaction managers.
2020-05-09 13:57:03 +02:00
Sam Brannen 29fe8cecbb Merge branch '5.2.x' 2020-05-08 19:49:56 +02:00
Sam Brannen ec3d647d1d Update spring-tx.xsd regarding reactive tx mgmt support
Closes gh-25030
2020-05-08 19:49:00 +02:00
Sam Brannen 8f7debc769 Merge branch '5.2.x' 2020-05-08 19:26:00 +02:00
Sam Brannen 0f22a5e409 Update Javadoc regarding reactive tx mgmt support
See gh-25030
2020-05-08 19:25:22 +02:00
Mark Paluch 2aa8aef216 Extend transaction attributes with labels
TransactionAttribute now exposes a labels attribute that associates a
descriptive array of labels with a transaction.

Labels may be of a pure descriptive nature or may get evaluated by
transaction managers to associate technology-specific behavior
with the actual transaction.
2020-05-06 16:28:21 +02:00
Sam Brannen 1d0c5195bc Polish Javadoc for TransactionManagementConfigurer 2020-04-06 15:31:48 +02:00
Sam Brannen 144b0e1437 Test status quo for @Primary + TransactionManagementConfigurer
This commit introduces tests for the status quo in production support
for multiple transaction managers registered as @Primary and via the
TransactionManagementConfigurer API.

See gh-24869
2020-04-06 15:16:31 +02:00
Sam Brannen f8ab19dc68 Ensure @EnableTxMgmt tests actually test something 2020-04-06 14:32:34 +02:00
Sam Brannen e26764d249 Remove duplicate words in documentation and polish Javadoc 2020-03-31 12:17:58 +02:00
Qimiao Chen 70581d1ea2
Improve javadoc in RollbackRuleAttribute regarding nested classes
Closes gh-24682

Co-authored-by: Sam Brannen <sbrannen@pivotal.io>
2020-03-15 12:06:16 +01:00
Juergen Hoeller 193f419520 Deprecate PTM-based constructors in favor of generic TransactionManager
Closes gh-24612
2020-03-11 14:52:03 +01:00
Rossen Stoyanchev adc13f2030 Polishing contribution
See gh-24493
2020-02-20 17:58:47 +00:00
陈其苗 a09f02f64e Minor refactoring in AbstractPlatformTransactionManager
See gh-24493
2020-02-20 17:33:18 +00:00
Juergen Hoeller d1c7083e77 Consistent ROLE_INFRASTRUCTURE declarations for configuration classes
Closes gh-24509
2020-02-12 16:49:02 +01:00
Michael Simons 711fafc924
Improve assertion message in PersistenceExceptionTranslationInterceptor
Closes gh-24484
2020-02-06 15:41:33 +01:00
Sam Brannen 5581f3b77b Use Gradle test fixture support for spring-tx
See gh-23550
2020-01-02 16:01:35 +01:00
Sam Brannen 726b1bb1d0 Rename test fixture package in spring-context
See gh-23550
2020-01-02 16:01:35 +01:00
Sam Brannen 7cd4ddf5fc Rename test fixture package in spring-beans
See gh-23550
2020-01-02 16:01:35 +01:00
Sam Brannen 4260c34b47 Rename test fixture package in spring-core
See gh-23550
2020-01-02 16:01:34 +01:00
Sam Brannen 61d4ee594d Use Gradle test fixture support for spring-beans and spring-context
See gh-23550
2020-01-02 16:01:34 +01:00
Sam Brannen 5718bf424b Use Gradle test fixture support for spring-core
See gh-23550
2020-01-02 16:01:34 +01:00
Juergen Hoeller a4f75e9c6a Polishing 2019-12-09 13:29:00 +01:00
Sam Brannen 9f00eb68e9 Clean up warnings 2019-10-30 19:14:58 +01:00
Christoph Dreis 3c17178b16 Fix Mockito deprecations 2019-10-30 18:30:05 +01:00
Juergen Hoeller 43a86565ca Consider target transaction manager for reactive transaction decision
Closes gh-23832
2019-10-30 16:23:37 +01:00
Mark Paluch 0d8aa854e8 Add tests for cancellation of transactional streams
See gh-23864

Closes gh-23873
2019-10-25 17:16:33 +02:00
Andreas Killaitis f838590300 Commit on cancelled subscription in TransactionalOperator::transactional
Prior to this commit, TransactionalOperator::transactional did not close
the transaction when cancelled.

Closes gh-23864
2019-10-25 14:48:46 +02:00
Sebastien Deleuze b24ac74106 Restore TransactionOperations Kotlin API compatibilty
This commit renames the Runnable variant to executeWithoutResult
and uses a Consumer<TransactionStatus> parameter for better
consistency with TransactionCallbackWithoutResult.

Closes gh-23724
2019-09-29 19:31:12 +02:00
Juergen Hoeller 2861fc65bd Polishing 2019-09-27 10:17:56 +02:00
Sebastien Deleuze 091c512f0d Upgrade to Coroutines 1.3.2
Closes gh-23663
2019-09-25 21:51:04 +02:00
Juergen Hoeller a48c13ae73 Avoid deprecated usingWhen method in Reactor 3.3
Closes gh-23562
2019-09-20 21:54:18 +02:00
Mark Paluch 393a81d4a9 Omit cancellation of transactional Monos in TransactionOperator
TransactionOperator.as(Mono) now no longer short-cuts via a Flux.next() but provides an implementation via Mono.usingWhen(…).
The short-cut previously issued a cancellation signal to the transactional Mono causing the transaction cleanup to happen without a handle for synchronization.

Using Mono.usingWhen(…) initiates transaction cleanup when the Mono completes eliminating the need for cancellation of the transactional Publisher.

This change does not fully fix gh-23304 but it softens its impact because TransactionalOperator.transactional(Mono) avoids cancellation.
2019-09-20 20:48:39 +02:00
Sebastien Deleuze fc6480631e Improve Coroutines transaction API
As a follow-up of gh-22915, the purpose of this commit is to improve
Coroutines programmatic transaction API to make it more consistent with
the Java one and more idiomatic.

For suspending functions, this commit changes the
TransactionalOperator.transactional extension with a suspending lambda
parameter to a TransactionalOperator.executeAndAwait one which is
conceptually closer to TransactionalOperator.execute Java API so more
consistent.

For Flow, the TransactionalOperator.transactional extension is correct
but would be more idiomatic as a Flow extension.

This commit also adds code samples to the reference documentation.

Closes gh-23627
2019-09-12 14:45:03 +02:00