I have been working on a website using mod_python, python, and SQL Alchemy when I ran into a strange problem: When I query the database for all of the records, it returns the correct result set; however, when I refresh the page, it returns me a result set with that same result set appended to it. I get more result sets “stacked” on top of eachother as I refresh the page more.
For example:
First page load: 10 results
Second page load: 20 results (two of each)
Third page load: 30 results (three of each)
etc…
Is this some underlying problem with mod_python? I don’t recall running into this when using mod_wsgi.
Not that I’ve ever heard of, but it’s impossible to tell without some code to look at.
Maybe you initialised your result set list as a global, or shared member, and then appended results to it when the application was called without resetting it to empty? A classic way of re-using lists accidentally is to put one in a default argument value to a function.
(The same could happen in mod_wsgi of course.)