You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Analysis performed in conjunction with #18465 has made it apparent that there was a regression from Spring 4.0.x to 4.1 and higher.
Since Spring 4.1, if a PlatformTransactionManager is neither present nor properly detected (i.e., due to the presence of multiple transactions managers), then a test annotated with @Transactional will be executed without a transaction and without any warning.
The deviates from the behavior in Spring 4.0.x and earlier versions in which an exception was thrown in such cases, letting the user know that the transaction manager could not be retrieved.
Deliverables
If a test method or test class is annotated with @Transactional, ensure that an exception is thrown if the PlatformTransactionManager cannot be retrieved.
Addressed in GitHub commits 6d2b9a0 and 484dd96 for Spring Framework 4.3 and 4.2.5, respectively.
Throw exception if TxMgr cannot be retrieved for @Transactional test
Prior to this commit, a @Transactional integration test would silently
be executed without a transaction if the transaction manager could not
be retrieved from the application context -- for example, it no such
bean was defined or if multiple beans were present but none satisfied
the qualifier.
This commit addresses this issue by throwing an IllegalStateException
if the PlatformTransactionManager cannot be retrieved for a @Transactional test.
Sam Brannen opened SPR-13895 and commented
Status Quo
Analysis performed in conjunction with #18465 has made it apparent that there was a regression from Spring 4.0.x to 4.1 and higher.
Since Spring 4.1, if a
PlatformTransactionManager
is neither present nor properly detected (i.e., due to the presence of multiple transactions managers), then a test annotated with@Transactional
will be executed without a transaction and without any warning.The deviates from the behavior in Spring 4.0.x and earlier versions in which an exception was thrown in such cases, letting the user know that the transaction manager could not be retrieved.
Deliverables
@Transactional
, ensure that an exception is thrown if thePlatformTransactionManager
cannot be retrieved.Affects: 4.1.7, 4.2 GA
Issue Links:
The text was updated successfully, but these errors were encountered: