newbiw on Spring and need to use declarative transaction management.
All examples i have seen so far does something like:
1. A TransactionManager service.
2. This defines the db operation methods with @Transaciton annotation's
3. A client invokes these methods and voila everything is done.
but these examples does not help me understand how its is generic... as there are set of defined operations which a client has to invoke and have the task done.
Secondly, for every new db operations again the full implementation needs to be done.
and so on.. this is the fist time i am handling spring.
Here is my understanding of what i have been asked to achieve:
1. A global transactionManager service, which will be using using JTA.
2. There needs to be some sort of TransactionListener service which will listen for (as the name suggests
)
3. All other business logic classes will just declare there methods as @Transactional.
4. So somehow magifically everything inside these business classes should be in a transaction and everything like begin/commit/rollback gets managed by itself via point 1 & 2 above.
do i make sense ? if by chance yes what i asked is that even possible ?
If yes please help...
(i have tried and tried and tried again.. to read the spring documentation... but hardly anything clicks in my mind)