[sqlalchemy] Re: session.clear() not clearing cascaded items?

2007-06-21 Thread svilen
That is, in my case, lifetime of objects is much longer that lifetime of all database-and-related stuff - and seems this is not expected pattern of usage. more questions on the theme. What is the expected sequence / lifetime / pattern-of-usage for engine, metadata, mappers, and finally, my

[sqlalchemy] Re: session.clear() not clearing cascaded items?

2007-06-21 Thread Michael Bayer
On Jun 21, 2007, at 6:59 AM, svilen wrote: more questions on the theme. What is the expected sequence / lifetime / pattern-of-usage for engine, metadata, mappers, and finally, my objects? mappers need tables and therefore metadata, objects have mapped properties and therefore mappers. no

[sqlalchemy] Re: session.clear() not clearing cascaded items?

2007-06-21 Thread sdobrev
thanks a lot, that cleared some mist. btw u can make a entry on the FAQ from this... e.g. lifetimes and usage patterns - or similar. The other rule inferred from above problem is b) objects lifetime should be shorter than mappers (ORM); else one needs to delete o._instance_key and

[sqlalchemy] Re: session.clear() not clearing cascaded items?

2007-06-20 Thread svilen
i think i found something... i am doing testing about these links and nodes. For each testcase i have one constant set of nodes, and then trying different scenarios with various combination of links. Each scenario creates all database stuff a new - db, metadata, mappers, session - and after