William Worth wrote:

> How would you suggest using your servlet to access a database then ?
> TCP/IP sockets (interprocess comms) are not serializeable either...
>

The most common solution is to store a connection pool in the ServletContext
attributes, or in a static variable.  Besides the serializability issue,
connection pools let you share a given number of JDBC connections between a
much larger pool of actual users, instead of having a connection per user
needed when you store connections in the session.

By the way, the reason for the "Serializable only" restriction is so you can
run your servlets in a servlet container that supports distributed
operations.  The 2.2 API specification (released after Jason's book) clarified
this requirement to only apply when you set the <distributable/> flag in your
web application deployment descriptor.  Otherwise, it doesn't matter.

Craig McClanahan

___________________________________________________________________________
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