Results 1 to 2 of 2

Thread: Threads and Transaction.

  1. #1
    Join Date
    Dec 2009
    Posts
    15

    Default Threads and Transaction.

    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
    Last edited by SpringBuddy; Aug 3rd, 2010 at 02:02 AM. Reason: Grammer

  2. #2
    Join Date
    Jul 2011
    Posts
    13

    Default

    Quote Originally Posted by SpringBuddy View Post
    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
    HI, Have you solved this problem? I think I have the same scenario as you.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •