Hi! I don't use sqlalchemy, I opening the connections from dbutils/pgdb. So I need some finalizer routine that run after the action, and this can drop the db connections with "rollback".
Have Pylons some before/after routines/methods? And they are running also if I make some error (abort, redirect, unhandled exceptions)? Thanks for your help: dd On jún. 29, 19:36, "Thomas G. Willis" <[email protected]> wrote: > On Jun 29, 1:22 pm, durumdara <[email protected]> wrote: > > > > > > > Hi! > > > I have a problem with PGSQL and dbutils, because I need to finalize my > > db connections. > > > The Postgresql have two trs. modes. The first is "in-transaction > > mode", and the second is "autocommit" mode. > > My experience is that when I use dbutils/pgdb with it's "in- > > transaction mode", and I make only "select" on a table, and I do not > > rollback it - it "locks" this table, and I cannot alter it. > > > Sometimes the transactions are remaining in "non-committed" state (non- > > handled exceptions, redirecting, etc.), so I search for a way to > > finalize them. > > > But: I don't want to make a try/finally blocks for each requests. > > > Please help me: have the Pylons a possibility where I can hook to a > > postprocess thread method? > > > A method that called after each process - and where I can reset my db > > connections? > > > Other way if I make my own dbutils: I put the db objects to a list on > > __del__, and I can re-call them on when I need to use them. In my way: > > auto-rollback on die, auto-rollback on birth... > > But this is gc-dependent are, so possible it would be better if I can > > handle them in pylons-level, not in gc-level... > > > Thanks for your help! > > > dd > > Are you using sqlalchemy? I think autoflush or autocommit on the > sessionmaker is what you would want. > > http://www.sqlalchemy.org/docs/05/reference/orm/sessions.html?highlig... > > have a look in the model/__init__.py of your pylons project --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-discuss" 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/pylons-discuss?hl=en -~----------~----~----~----~------~----~------~--~---
