Here is one of the sites that I had read.
http://www-1.ibm.com/support/docview.wss?rs=180&context=SSEQTP&q=J2CA0075W&uid=s
wg21109248&loc=en_US&cs=utf-8&lang=en+en
It does mention EJBs, but the part after that was the part I was
concerned about.
"If a Servlet is spinning its own threads and accessing a database,
the J2EE specification is not clear on this, so WebSphere Application
Server 5.0 will allow it at this time. IBM is working with Sun to
clarify this in the specification, so eventually (i.e. J2EE 1.4) spun
threads from a Servlet accessing a database outside of a transaction
will not be supported either."
Any comments on that?
> > I have been reading a lot of posts and websites about not creating
> > your own threads in a servlet and that you should not do it because it
[quoted text clipped - 39 lines]
>
> Silvio Bierman
Nathan Zumwalt - 30 Dec 2003 18:52 GMT
Most of the time, a better and safer means of assynchronous execution
is available (such as JMS). Unfortunatly, it seems your case is one
of those few that really needs threading. I would still avoid using
your own threads, though... if you're getting data from such disparate
sources, your users should expect some performance degredation. If
all this data is frequently accessed, then you really need a data
mart.
It would be nice if the JSP spec had some kind of assynchronous
include for cases like this one. Something like:
...
<jsp:include page="page1.jsp" assync="true"/>
<jsp:include page="page2.jsp" assync="true"/>
<jsp:include page="page3.jsp" assync="true"/>
...
This assumes that concurrent access to shared resources (such as the
session) is allowed. I wouldn't think this would be something too
difficult for a servlet container to implement.
-Nathan
> Here is one of the sites that I had read.
>
[quoted text clipped - 54 lines]
> >
> > Silvio Bierman
Scorpio - 04 Jan 2004 10:59 GMT
> Here is one of the sites that I had read.
http://www-1.ibm.com/support/docview.wss?rs=180&context=SSEQTP&q=J2CA0075W&u
id=swg21109248&loc=en_US&cs=utf-8&lang=en+en
> It does mention EJBs, but the part after that was the part I was
> concerned about.
[quoted text clipped - 6 lines]
>
> Any comments on that?
Hi,
I encountered the same problem a couple of weeks ago... My problem was, I
needed periodically start task (checking mail and execute some queries on
database) and I thought to use "independent" threads...
I found out the same IBM document you have reported in your post.
Well, the solution to this problem is EJB 2.1 specification, which provides
a new EJB type ( Timer EJB) which will allow programmer to execute periodic
task.
I use WebSphere 5 too, but I do not know which version would support EJB 2.1
specs.
To solve my problem, I've started an external thread which periodically
executes SOAP calls to business logic classes on application server.
Regards,
Scorpio.