g venkata wrote:I have three doubts in perofrmance fix
3. This is regarding JDBC and JSP using Oracle10g,Tomcat and JBOSS.Currently this is the scenario. I am retreiving more than 1000 records in resultset. But actually the user requires 10 records..rarely he requires 1000 records. Am iterating thru a loop in DAO class and getting that particular records in while(resultset,next()) and passing them to JSP (thru request obect)
If the user again requests for 20 records..am again doing the same.
Because of this the query is executing again and again. and the server is becoming very slow.
(The code written long back and also not upto the standards and performance is not considered while developing)
But Now, i want to change it like..
Mike Simmons wrote:The most common cause for this sort of problem is failure to close the stream. So, are you absolutely sure that the stream was closed? What if an exception was thrown during the file reading - would you see it? Would the stream get closed regardless? (This is a good use for a "finally" block.)
Also - are you sure there aren't any other streams using the file? Reading or writing? If there are, make sure they're closed as well.
If you've checked this and are sure everything is closed, I don't know. There may be a defect in the filesystem - or in the Java implementation of file I/O activities. Depending on your perspective. Try inserting a short pause (e.g. with Thread.sleep()) in the program before you try to rename - does it make a difference?