A thread is a standard java thing while a session is specific to servlets (unless
there are other definitions that I am unaware of.
A thread is a light weight process that can be started to run some code in parallel to
the main execution of your program. It is ideal in gui programming where you want to
access a database maybe via a slow connection and also want to provide status
information to the user. A thread is started to access the database and the main
program can still remain active and responsive to the user by providing feedback on
what is happening.
A session in a servlet enables a servlet to store information, maybe some state
information. Classic examples of the use of this is the shopping cart. I use it to
store information required to re-run a report. For each browser session a servlet
engine can store information (on the server) that can then be retrieved the next time
a servlet is run. Each value or object that is stored in the session has a name, so
multiple values or objects can be stored.
kev
-----Original Message-----
From: Joseph Seah [mailto:[EMAIL PROTECTED]]
Sent: Monday, 28 February 2000 13:04
To: [EMAIL PROTECTED]
Subject: sessions vs threads
would like to someone to shed some light on the differences between sessions
and threads. do servlets allow multi-threading or session is enough? or
sessions and threads are the same thing???
EOM
NOTICE - This message contains information intended only for the use of the addressee
named above. It may also be confidential and/or privileged. If you are not the
intended recipient of this message you are hereby notified that you must not
disseminate, copy or take any action in reliance on it. If you have received this
message in error please notify [EMAIL PROTECTED]
___________________________________________________________________________
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