1 Reply Latest reply on Jun 7, 2008 7:48 AM by yijing wu

    Spawning new treads from MDB

    Ivan B Novice

      Hi,

      I know, I know, the spec says I shouldn't do that. But, honestly, in practice, there are situations where spawning new threads from MDB (or SB for that matter) might be acceptable, aren't there?

      For example, I need to fetch some data from a number of DB servers and put that data onto some another DB servers, while the whole process must be triggered from MDB. The task begs to be threaded, but do you think I should follow the EJB recommendation and do it all sequentially or I'd be better off taking the multi-threading path regardless the cautions?

      My only AS is JBossAS, I'm not particularly concerned about porting the code on any other AS.

      Any advice is highly appreciated,

      vanyatka

        • 1. Re: Spawning new treads from MDB
          yijing wu Newbie

          Well, it seems there is nobody answered your question yet, just in case you have got any clue, in my experience and opinion, you could just place anohter JMS queue or topic to do it in a new JMS session, it'll use a container managed thread to achieve multi-threading process, this will fully comply to the spec and J2EE standard.