I may have found the problem..... It turns out this problem only occurs if I use the cherrypy auth_basic to provide authentication. In my authentication checkpassword function I was querying the user table without using sessions. Adding a session rollback, clear and close to the end of this function removes the problem.
I had wrongly assumed that using a tool to wrap requests in transactions that the authentication would also be wrapped. So far so good... On Mar 15, 11:25 am, Andrew <ajpere...@googlemail.com> wrote: > Hi, I have a problem where multiple connections to a MySQL database > (through sqlalchemy from a cherrypy multithreaded web server) get > different views on the same data. > Scenario: > A user submits a form to create a new record in a > table > Cherrypy adds the record and returns an httpredirect > to a url that views that new record > The new http request fails as it does not think the > new record exists yet. > Refreshing the page after a few seconds successfully > finds the record. > More info: > 1)This website worked perfectly when I used sqlite as a backend. > 2)Even with mysql as a backend, if I query the database from a mysql > gui just after creating the new record via the web, then I cannot get > this behaviour to happen. > 3)Turning echo on for sqlalchemy reveals that the select statement is > being issued. > 4)This problem only seems to happen if the web page also contains > multiple static images that are being requested at the same time - if > I make the page only reference one image the problem goes away - > suggests some timing problem I guess. > 5) I am using elixir and the sqlalchemy_tool wrapper to manage the > session > > Any help/pointers would be really appreciated. > Best Regards, > Andrew -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.