Transactions, Spring.
are using @Transactional over a method or class Spring uses a tiny trick. It does not just instantiate for example a UserService, but also a transactional proxy of that UserService. It does that through a method called proxy-through-subclassing with the help of the Cglib library. There are also