Doc: Class-level @Transactional
doesn't demarcate transactions for public methods in parent class [SPR-17445]
#21977
Labels
in: data
Issues in data modules (jdbc, orm, oxm, tx)
status: backported
An issue that has been backported to maintenance branches
type: task
A general task
Milestone
Josh Long opened SPR-17445 and commented
i have a class that has a
@Transactional
on the class itself. It inherits from a base class. The base class implements an interface with methods on it and has a public methods in it.My expectation is that the public methods in BaseService should be demarcated in a transaction. If I do nothing but override the methods and then call the super implementation, things work as expected.
the good Dr. dsyer investigated the issue further.
My code is https://github.com/reactive-spring-book/bootstrap/blob/master/src/main/java/rsb/bootstrap/enable/TransactionalCustomerService.java
If you remove the 3 methods, findById, save, and findAll, they are still public methods in BaseCustomerService. I have a test that tests that i can write data to the DB and see it roll back. the test fails if i have removed those methods. it succeeds when i add them.
Affects: 5.1.2
Referenced from: commits ea3250c, 561511f, f002ebd
Backported to: 5.0.11, 4.3.21
The text was updated successfully, but these errors were encountered: