> At 05:20 PM 5/13/99 , jon * wrote:
> >
> >No "guru" here in his/her right mind would suggest using STM
> to implement a
> >servlet.
> >
>
> So it is totally useless for any servlet devo work and *no*
> knowledgable
> person would suggest using it? Sun made a mistake in
> including it in their
> servlet API?
>
Although I never use STM I can't say no one ever should. I believe it was
added to the JSDK in version 2.0. If someone didn't feel there was a need
for it, it never would have been added. I can see where it would make things
much simpler if you don't want to worry about synchronization issues. I
guess by now I always write code assuming it will be used in a
multi-threaded environment.
When I first started writing servlets (coming up on two years ago) I didn't
know that one instance could serve several requests so my servlet had
problems when I moved it from servlet runner to a real web server. STM would
have saved me from rewriting some code back then. I don't use it now because
of performance issues. When you use STM all requests going to your servlet
will be synchronized so that only one request may be handled at a time
(unless your servlet runner creates multiple instances of your servlet).
You should definitely take a look at DbConnectionBroker at
http://www.javaexchange.com. It's free and there are examples of using it
with servlets.
> Really, I appreciate the comments, I am just a newbie after
> all and very
> willing to learn - I just am very wary when people make
> absolute statements.
>
> >
> >Ok, I see why they suggested using STM, but really, you are
> going to end up
> >biting yourself in the foot for having used it. Learn how to use a
> >connection pool, it isn't that hard and dump STM.
> >
>
> Is there a resource you could point me to that would tell me
> why the STM
> should not be used for servlet devo work, or maybe you could
> explain for my
> benefit?
>
> Thanks,
> LCB
___________________________________________________________________________
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