This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes apparent caching of result set Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "apparent caching of result set" Watch "apparent caching of result set" New topic

apparent caching of result set

Tom Griffith
Ranch Hand

Joined: Aug 06, 2004
Posts: 257
Hi. I have a controller jsp that calls a bean that performs a jdbc query against an oracle table, does some mathematical operations like caclulate averages, etc, and returns a reference to an ArrayList of results to the jsp. The results are displayed in a table. My problem is that whenever I change data in the table, whether deleting rows or adding them, I keep getting the very same result that I did the first time I ever loaded this page. Does anybody know what is happening...I have rebooted my client, deleted Temporary Internet files, etc. Even the next day, I get the same old result. Thank you.

Does this have something to do with maybe the ArrayList being held in memory by the server?..but over days?...
Tom Griffith
Ranch Hand

Joined: Aug 06, 2004
Posts: 257
Any browser is receiving the same something is cached on the server...any help is appreciated.

Oh, I just tried clearing the arraylist in the bean before using and it doesn't help.
Tom Griffith
Ranch Hand

Joined: Aug 06, 2004
Posts: 257
Hmm, it's turning out to be a database problem. Afte rputting some print statements in the bean, the numbers were coming in the same. So I went to the SQL client and found records that I thought were deleted via the SQL client (was attempting to clean out test records) were still there. This even after it told me "n rows deleted" when I fed it the DELETE command.
Jeanne Boyarsky
internet detective

Joined: May 26, 2003
Posts: 30076

It sounds like you deleted the rows from the database command line. Did you commit your changes when done?

[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
I agree. Here's the link:
subject: apparent caching of result set
Similar Threads
JSTL to Servlet
Need to access a variable in jsp from action class
display search results as sets of pages
DB Processing Cost
Submitting a table in a form