Forums Register Login

synchronized problems in JSP/Sverlet, please help!

+Pie Number of slices to send: Send
There isn't a new instance of the Servlet/JSP for each request in Tomcat - they are probably all calling the same instance so any state will be shared. If I Connection is stored as a member variable then I'll have synchronized problems with it already being in use if two people hit the page at the same time.
Incidentally, although it might work, synchronizing the database access in the JSP would be a bad idea since I�d just create a queue of requests waiting to use the one Connection whereas I really need a number of Connections to deal with everyone simultaneously.
What I do? Need any advice from you.
Sincerely
Urey
+Pie Number of slices to send: Send
urey
Welcome to the Java Ranch, we hope you’ll enjoy visiting as a regular however,
your name is not in keeping with our naming policy here at the ranch. Please change your display name to an appropriate name as shown in the policy.
Thanks again and we hope to see you around the ranch!!
Please do not cross post your questions to multiple forums. Most of the visitors here read in many of the forums and it is frustrating to see the same question repeated over and over. You have a better chance of getting a correct and timely answer if you post it to the most appropriate forum instead of using the shotgun approach and hoping you'll hit something.
Please post any additional posts about this to the thread you have started in the JSP forum right here
[ April 30, 2002: Message edited by: Dave Vick ]
She still doesn't approve of my superhero lifestyle. Or this shameless plug:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


Reply locked
This thread has been viewed 1356 times.
Similar Threads
why jsp cannot use this class, which is no problem when compile singlely.
Synchronized problems in JSP/Servlet, please help me.
number of instances of JSP
JDBC Newbie: Understaning 'Connection'
What is the approach for enabling thread safe servlets
JSP Thread question
JSP service method synchronization
Is Servlet threadsafe ?
instance variables of controller in Weblogic 8.1
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 12:59:47.