> Well, let's use the word "ignorant" instead of "stupid" since that is what
> we are really talking about here; whereas ignorance is a lack of knowledge
> and stupidity is the inability to reason or make intelligent decisions.
> Everyone is ignorant on one subject or another - most people should not be
> characterized as stupid (except for intermittent instances where we all
> have done or thought something stupid). Those people who are stupid are as
> a general rule going to stay stupid whether Sun includes the STM model or
> not - 'nuff said.

Right, all good points.

> Anyway, I don't have a problem with allowing someone use a lightweight or
> simple model of something when they need to throw something together
> quickly. There is always the potential for misuse but that is another issue
> (can you tell I am the kind of guy who pines for C++ operator overloading
> in Java? ;-).

Again, using STM isn't any more lightweight than not using it. You get no
coding benefit from using it other than the fact that you do not have to
manage syncronizing variables within your servlet. I think that you are
thinking that for this particular project it is better to have non-threaded
code only for the reason that it prevents you from having to understand
multithreaded issues and servlets. That is not the right way to look at this
issue.

I repeat, using STM does not lower your development time or really make it
any easier.

> The way I understand the STM from the API docs, if
> multiple users are using these forms the servlet engine will invoke a new
> instance of the servlet, or use an instance of the servlet from a pool of
> instances.

Apache JServ (the engine I am most familiar with) will, by default, create 5
instances of your servlet and then rotate through them. The issue here is
that if you declare a variable as being "global" within that servlet, only
that servlet can see that variable. In other words, if you have a page
counter servlet and you are the only person hitting it, there is a chance
that on one page the counter will say 1 and on another request also say 1.

> Other code used by the servlet needs to be thread safe yes, but that is not
> that much of a problem. Remember, this is not some e-commerce application
> that is seeing lots of hits, most of the time only two or three people
> (developers) are going to be accessing the database via our *intranet*
> (*not* the web) at any one time. Unless we suddenly become the size of MS
> we are not likely to need to scale this up either. This is a quick and
> dirty internal tool for our developers.

Again, that is not the reason to use STM.

> I fully intend to learn all the nuances of multi-threading in Java (I have
> done mutli-threading in C++), but I have a limited amount of time to
> implement this particular project so I can go back to writing UI components
> that will be used in production code.

If you understand MT in other languages, then you should understand it in
Java. MT is MT. This is basic Computer Science we are talking about here.

> Anyway, I think I understand the problems now - thank you for your help.

Your welcome and i'm glad that you took the time to understand the issues
involved.

-jon

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to