in me J2EE web based application,user click a button on a page,this will call a long process.to 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.
-
dealing with long process (3 messages)
- Posted by: zhang zhang
- Posted on: January 13 2005 11:05 EST
Threaded Messages (3)
- dealing with long process by Fredrik Borgh on January 17 2005 04:17 EST
- dealing with long process by Martin Straus on January 18 2005 16:06 EST
- dealing with long process by zhang zhang on February 02 2005 11:35 EST
-
dealing with long process[ Go to top ]
- Posted by: Fredrik Borgh
- Posted on: January 17 2005 04:17 EST
- in response to zhang zhang
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. -
dealing with long process[ Go to top ]
- Posted by: Martin Straus
- Posted on: January 18 2005 16:06 EST
- in response to zhang zhang
I assume you don't want to present any results to the user, right?
Cheers and happy coding,
Martin -
dealing with long process[ Go to top ]
- Posted by: zhang zhang
- Posted on: February 02 2005 11:35 EST
- in response to Martin Straus
no,I can let user check result later
thank you