Thanks! I think that fixed it. I changed the 'using_options' parameter of each of my elixir classes to include 'session=turbogears.database.session', and the problem seems to have been resolved (we'll see if it shows up again randomly).
I've also figured out why the delay between changes in the database the widgets reflecting the changes; I wasn't paying attention to the 'proper' way to design widgets - I basically loaded a list of data when the widget is created and then call the display method in my templates. The correct way to do this would be to load the list of data at each pageload and pass it to the widget. Oops. -Ryan On Jun 14, 7:30 am, "Diez B. Roggisch" <[email protected]> wrote: > kerinin schrieb: > > > > > I am completely confused, I've found multiple conflicting posts about > > this, and my code seems to arbitrarily start throwing errors with no > > cause. > > > 1) Do I need to explicitly call session.begin() and session.close()? > > I read in one place that importing turbogears.session makes these > > calls unnesseccary (i.e. I can just use session.save(), session.commit > > () and session.rollback(). This approach was working fine for a week > > and now is completely broken. > > > 2) If I use session.begin() and session.close(), how do I ensure that > > the session being used to render pages is synchronized with the > > database? I find that any time I create a new session, change an > > object, commit it to the database and then close the session, the rest > > of my app doesn't reflect the changes for a few minutes. > > > 3) Is there anything I need to change from the quickstart to get this > > working? I had to add elixir.setup_all() to the end of my model for > > that to work - is there anything similar that needs to be setup to > > make sessions work? > > > Please please help, I'm completely lost and the whole app is starting > > to implode with transaction errors. > > The Session-stuff of SA/Elixir has bitten me countless times, as much as > I like a lot of aspects of those two - it really is a major PITA. > > I'm not sure if I can help you, but this is what helps me debug this stuff: > > - ramp up the SQL-logging-level of the engine so you see what's being > issued. Pay especially attention to begin/commit/rollback, and also > especially when modifying statements (inserts, updates, deletes) are > part of the transaction. > > - make sure your elixir-models belong to the *same* session-object TG > uses! If not, they may even inject SQL into the DB, but being part of an > otherwise uncared session never get commited. > > Diez --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~----------~----~----~----~------~----~------~--~---

