The moose likes Spring and the fly likes Threads and Transaction. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Application Frameworks » Spring
Reply Bookmark "Threads and Transaction." Watch "Threads and Transaction." New topic
Author

Threads and Transaction.

Dominic Marinaro Soundranayagam
Greenhorn

Joined: May 19, 2010
Posts: 3
Hi Guys
I am stuck in the following scenario.Please advice me on this

There is an inbound Queue
There is an Main thread running(We are not using JMS Listener )
and picking a message from the queue and process the message
and start another sub thread to process again.

Now the problem is How can i handle the transaction in the main thread and sub thread as well.
which mean when i process the message in main thread say some Data Base access error occurs
so i want to rollback the message back to inbound Queue.
and if the same failure occurs in sub thread which was created by the main thread, the retrieved message should rollback to inbound Queue.

I have walked through the JMS Spring Reference ,But they are demarcate the transaction only to JMS Listeners
So How can i apply the transaction concept in my scenario
Please advice me ,If you have any sample program please share with me .That would be better to understand your concepts

Thanks and Regards
Dominic
Junior Developer
 
IntelliJ Java IDE
 
subject: Threads and Transaction.
 
Threads others viewed
how to involve Java messaging in a distributed transaction
two tier or three tier
Separating JMS Producer/Consumer on JBoss 4.0.2
JMS rollback to Dead Letter
Hibernate & J2EE
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com