[sqlalchemy] Inactive transactions and commit/rollback from Session

2009-11-12 Thread Hans Lellelid
Hi - I'm using SA in conjunction w/ Pylons, in their default (0.9.7) approach -- i.e. using scoped session classes created by calling something like: sm = orm.sessionmaker(autoflush=True, autocommit=False, bind=engine) meta.Session = orm.scoped_session(sm) I have a base controller that is

[sqlalchemy] Understanding CircularDependencyError

2009-11-12 Thread Joril
Hi everyone! I'm using the Declarative plugin to generate/handle a DB of about 50 entities, with every kind of relation between them. I've just added a simple one-to-many relation, and now SA is complaining that: sqlalchemy.exc.CircularDependencyError: Circular dependency detected [(base_files,

[sqlalchemy] Re: Understanding CircularDependencyError

2009-11-12 Thread Joril
It looks like I should tinker with the use_alter parameter.. :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from

[sqlalchemy] Re: Identical column names in parent and child classes with joined-table inheritance

2009-11-12 Thread xaotuk
We have tried suggested, but: field 'modified' exists in both parent and child tables, when we redefined property 'modified' in mapper with something like this: mapper(Child, child_table, properties={'modified' = child_table.c.modified, ...}), modified field still returned value from parent's

[sqlalchemy] Re: Inactive transactions and commit/rollback from Session

2009-11-12 Thread Michael Bayer
Hans Lellelid wrote: The errors (The transaction is inactive.) are coming from my meta.Session.commit() line. Two questions: 1) Isn't this what meta.Session.is_active should be testing for? it is. I'm not familiar with a codepath which can cause that to happen, and in fact even if the

[sqlalchemy] Re: Identical column names in parent and child classes with joined-table inheritance

2009-11-12 Thread Michael Bayer
xaotuk wrote: We have tried suggested, but: field 'modified' exists in both parent and child tables, when we redefined property 'modified' in mapper with something like this: mapper(Child, child_table, properties={'modified' = child_table.c.modified, ...}), modified field still returned

[sqlalchemy] Re: Inactive transactions and commit/rollback from Session

2009-11-12 Thread Hans Lellelid
Hi Michael - Thanks for the response! 1) Isn't this what meta.Session.is_active should be testing for? it is.   I'm not familiar with a codepath which can cause that to happen, and in fact even if the session isn't active, it still should be totally fine to call commit().  Try this as an