problem with result set,if multiple users access the application

Hi all!! I have made a web based application(servlets & jsp pages) which runs fine if accessed from a single m/c. but if muliple users(even if two) happen to access the application, it causes result set errors e.g. result set is closed or invalid cursor state exception etc please throw some light... thanks in advance Lusha

Please check if same Statement is being used by both the users. I mean see if you are doing connection.createStatement() at some heigher level and Statement.executeQuery() in some particular method which is being accesed by multiple users. If yes, try after taking your connection.createStatement() inside the method.

lusha tak
Ranch Hand

Joined: Dec 30, 2000
Posts: 185

posted Sep 21, 2001 00:13:00

0

Thanks Amit for the prompt reply. but no methods are involved in the picture as all are jsp files. see,if u can guide sth. further.. thanks & regards Lusha

Sounds like you're saving your database objects as instance variables and that your servlets are not thread safe. But hard to make a fix in the dark though, do we get to see any code? Dave.

lusha tak
Ranch Hand

Joined: Dec 30, 2000
Posts: 185

posted Sep 22, 2001 04:13:00

0

Hi all! thanks for ur concern in solving out my query. as u asked for the code, i don't know how best i can represent it to u, as it's very easy easy to get confused with the project specific intricacies & database details. few points i would like to mention.... 1. i don't know, what do u mean by "thread safe sevlet" or jsp page for that metter (and i only know that web server takes care of it by itself.)please throw some light if u think it can help me... 2. i haven't closed my resultset object anywhere in the whole file (as if i go about doing that then tomcat causes even more problem.) i mean i haven't used the folowing code anywhere in the file resultset1.close(); resultset2.close(); statement1.close(); statement1.close(); conn.close(); now here is my code sample............................ ur help is very much required.... Thanks in advance lusha //my code sample............................starts here <%response.setContentType("text/html");<br /> response.setDateHeader("Expires",0);<br /> response.setHeader("Cache-Control","no-cache");<br /> response.setHeader("Pragma","no-cache");<br /> %>