File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Do I get better performance from running a query once a day and saving the info in an object? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Do I get better performance from running a query once a day and saving the info in an object?" Watch "Do I get better performance from running a query once a day and saving the info in an object?" New topic
Author

Do I get better performance from running a query once a day and saving the info in an object?

Archie Sheran
Greenhorn

Joined: Sep 08, 2009
Posts: 3
I inherited an application which opens to the public every february. During this february I was having up to 300 concurrent users acessing in less than a minute. I used up 60% of the cpu on a shared server and database connectivity was slooooooowwwwwwwww,aside from increasing the connection pool I would like to visit the database less often. Instead of going to a tablewith a list of city names and their code number I want to save this information into a java singleton object (the application goes down everyday at midnight for 10min while the information in the databse is extracted elsewhere so the singleton will be refreshed everyday and the list of cities hasnt been modified for years). Would I see a peformance benefit if I save this information in memory? (It is queried everytime a user logs in).

Thanks.
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 31069
    
232

Archie Sheran wrote: Would I see a peformance benefit if I save this information in memory? (It is queried everytime a user logs in).

Absolutely!


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Archie Sheran
Greenhorn

Joined: Sep 08, 2009
Posts: 3
thanks bud appreciate it
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Do I get better performance from running a query once a day and saving the info in an object?