From: Ian B. <ia...@co...> - 2004-09-30 15:46:25
|
CLIFFORD ILKAY wrote: > Hello, > > Since this question did not elicit any response on the Webware list and > since it could well be a SQLObject problem, I shall ask here as well. > > I am running WebWare 0.8.1, SQLObject 0.6, mod_webkit2, and PostgresSQL > 7.4.1 on Mandrake 10. I have a form that uses a JavaScript library to > make an xmlrpc call to WebWare. When the user enters a new item and hits > the Submit button, an xmlprc call is made which does an INSERT into the > appropriate PostgreSQL table via SQLObject and another xmlrpc call is > made which does a SELECT * on that same table so that the list of items > can be updated. The the new item is inserted and it appears on the list > of items displayed in a table on the form, no problem. Keep this in mind. > > I have a simple JavaScript routine that sorts the columns in the table > when the user clicks on a link representing the columns. I noticed that > the first item was not in the correct sort order. Upon closer > examination, I noticed it had a leading space. I went to a shell where I > had psql running and did a "UPDATE my_table set name = 'No Leading Space > Name' where id = 99". I refreshed the browser but saw the first row in > the table was still the item with the leading space. I double checked > from psql to make sure I had not made a mistake and sure enough, there > was no leading space and things sorted properly. I inserted another row > using the form described above. Again, the new item was added to the db > and to the table on the form but the problematic data remained > *unchanged*. In order for the new item to be added to the table, it had > to have come from the result of the xmlrpc request. If I restart the > AppServer and refresh the browser, the data in the table on the form > reflects what is in the db. SQLObject caches objects fairly aggressively. When you update something in the database without using SQLObject, the cache will still remain with the old (now incorrect) values. When you restart the AppServer, you are purging the cache, and hence the problem went away. You can refresh values with .sync() or .expire() (expire refreshes the values lazily). Right now there's no "expire everything" method, though there really should be. Does that explain your problem? -- Ian Bicking / ia...@co... / http://blog.ianbicking.org |