I have written a Java servlet that seems to work quite well but I am confused about the exact context in which it runs.
 
At initialisation it creates a JDBC connection and uses that to connect to a remote Oracle Database on each activation of the servlet. The connection remains open until the servlet closes down.
 
I can see that JServ and Tomcat (I am experimenting with both) create multiple threads, so presumably my servlet can handle multiple simultaneous requests? But what about that one JDBC connection.
 
Is there one per thread?
 
Is there protection so that only one thread can use the connection at a time?
 
Or should I have created some protection to prevent clashes?
 
Its very unclear and I'd appreciate a few clues as to the real situation.
 
Regards
 
Gerry

Reply via email to