On making servlets thread-safe:
The approach I took with WebMacro (www.webmacro.org, it's free) was to
split everything into several categories, each with a different thread
policy.
WebMacro is based on a model/view/controller design so the thread
policy breaks down along those lines:
Templat
Thomas Moore wrote:
>
> Kevin said:
> > Another question about threading. I think this is something that definitely
> > needs to go into the FAQ.
> Comments welcome...
>
> FAQ Addendum - Threading in Servlets
> (Or What A Tangled Web We Weave)
And after I wrote that, I realized the other FAQ
(htt
Kevin said:
> Another question about threading. I think this is something that definitely
> needs to go into the FAQ.
Comments welcome...
FAQ Addendum - Threading in Servlets
(Or What A Tangled Web We Weave)
Are servlets thread safe?
Servlets are only thread safe to the degree that you, the prog
Mirko,
As John Kirby & Justin Wells have very well indicated, I think the basic
point is: partition, partition, partition. (Oh, yes, and encapsulate
properly at the same time.)
You could think of partitioning and encapsulation as two sides of the same
coin: you want to represent in the same cl
Mirko Wolf wrote:
> The first one will have no chance to complete the request, right?
Servlets are threaded by nature, but the DB stuff is up to you.
Alfonso.
___
To unsubscribe, send email to [EMAIL PROTECTED] and include
You can write an adapter to sit im front of the critical code and
control the number of threads allowed in.
Justin
www.webmacro.org / Java Servlet Framework
Quoting Mirko Wolf ([EMAIL PROTECTED]):
> Hi there,
>
> Here is another question how to design functions for a servlet.
> IMHO for every r
Another question about threading. I think this is something that definitely
needs to go into the FAQ.
Mirko Wolf wrote:
>
> Hi there,
>
> Here is another question how to design functions for a servlet.
> IMHO for every request made to a servlet the service function is called again.
Yes, service
Mirko-
The design pattern I find works the best with servlets is MVC. I use the
servlet to be the controller to handle requests and session management. The
view is either a JSP, template, or imbedded HTML in a presentation class.
The model or data portion is handled through separate classes.
T
Hi Mirko -
We usualy open a pool of database connections in the servlet's
init() method. Use a connection pooling object - there's probably
plenty available. The servlet's service() method executes in a
seperate thread for each request. so, inside the service() method,
you can grab a connectio