tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Wadkin <j.wad...@hud.ac.uk>
Subject Database servlets
Date Mon, 11 Feb 2002 13:47:22 GMT
All,

Although I don't need to write servlets, I thought it might be useful to
gain an understanding of how they work. Wished I hadn't bothered :)

A test servlet that connects to a database, read/writes, and closes the
connection, fails when more than one person requests the servlet. The author
of the servlet tells me that the servlet isn't multi-user and needs a few
"synchronised" statements.

I thought that:

A servlet creates a new instance of itself for each request
Oracle can handle multiple users

In view of this, I don't see why the servlet doesn't work or why it needs
"synchronising". Is there only one instance of the servlet for all requests
- i.e. the object that represents the database connection is shared, hence
the need for synchronisation. If so, then this means that only one
request/client can use the database at any given time - effectively making
Oracle a single user database. This can't be right. What am I not
understanding? I've gone through Sun's servlet tutorial and I'm none the
wiser!

Thanks,

John

Quote for the week (recalling Thursday's significance):

Love is like schizophrenia - both are caused by chemical imbalances in the
brain, both are incurable.

Anon.

--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message