Re: Need help with servlet thread safety...

2005-04-12 Thread Brett Zamora
Hi Nick... Thanks for the feedback. I did notice after I posted the code that I had not added the close for the Resultset and the Statement objects. I'm going to change the Connection around and try what you suggested to see if that causes the condition to disappear. One of the reasons I structu

Re: Need help with servlet thread safety...

2005-04-12 Thread Nic Ferrier
You have misunderstood synchronization and threads. You don't need to synchronize access to a bean created in a thread: >From SimpleCtl1.java: switch (nAction) { case 0: SimpleBean1 sb = new SimpleBean1() ; synchron

Re: Need help with servlet thread safety...

2005-04-12 Thread Emmanuel Eze
Hi, I had a look at your code. SimpleBean1 is not a servet but it makes use of the Servlet session tracking API. I think your desgn structure is fundamentally flawed. Emmanuel Eze Quoting Brett Zamora <[EMAIL PROTECTED]>: > Hi... > > I'm trying to build a JSP/Servlet application that will retri

Re: Need help with servlet thread safety...

2005-04-12 Thread Mark Beaty
Sorry, I found your code. I'll take a look at it and see if there is anything obvious (or not obvious). -Mark ___ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTERES

Re: Need help with servlet thread safety...

2005-04-12 Thread Mark Beaty
Why do you assume that this is a multi-threading issue. I don't see the code you said you provided, so my guess would be about as good as yours without seeing the code. Are you creating additional threads within your code? If so, why? Is it necessary? If not, then I doubt you're running into multi-

Re: Need help with servlet thread safety...

2005-04-11 Thread Narendra Krishna
Hi, If u want to threadsafe there is two ways. One is implements SingleThreadModel. But this will give good result but performance will be poor. Another way is u can synchronize some code using synchronized block(mainly database statements which ever is necessary). Take care when

Need help with servlet thread safety...

2005-04-11 Thread Brett Zamora
Hi... I'm trying to build a JSP/Servlet application that will retrieve, add, update, and delete records from a database. I've recently encountered some of the complications that can be seen if a servlet is not written to be thread safe. First I'd like to say that I've been reading and reading on