dealing with long process


General J2EE: dealing with long process

  1. dealing with long process (3 messages)

    in me J2EE web based application,user click a button on a page,this will call a long avoid the browser waiting for reply,there are two solutions:
    1. using messageing.the jsp call a message driving bean,and MDB call this process
    2. using multi-thread.the jsp call a classA and classA start a thread in another classB(which call process).

    which is better and WHY?

    thank you.

    Threaded Messages (3)

  2. dealing with long process[ Go to top ]

    I would say that solution 1 is the best, because then you don't have have to deal with the threading issue - and that's one of the main reasons for using an application server. Creating your own threads will interfer with the thread handling in the app server and will potentially affect performance in a negative way.
  3. dealing with long process[ Go to top ]

    I assume you don't want to present any results to the user, right?

    Cheers and happy coding,
  4. dealing with long process[ Go to top ]

    no,I can let user check result later
    thank you