File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Spring and the fly likes Spring transaction management with listeners Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring transaction management with listeners " Watch "Spring transaction management with listeners " New topic

Spring transaction management with listeners

Siddharth Khurana

Joined: Dec 12, 2011
Posts: 1
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)
Ankit Garg

Joined: Aug 03, 2008
Posts: 9462

Hi Siddharth welcome to javaranch.

I'm sorry but I don't understand what you are confused about. Do you want to understand how transaction management works internally or do you want to know how to configure it?

SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
I agree. Here's the link:
subject: Spring transaction management with listeners
It's not a secret anymore!