This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes JDBC and Relational Databases 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 OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
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: 275
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: 275
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: 275
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
author & internet detective

Joined: May 26, 2003
Posts: 32635

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

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: apparent caching of result set
It's not a secret anymore!