[sqlalchemy] Re: delete children of object w/o delete of object?

2007-12-06 Thread svilen
On Wednesday 05 December 2007 23:36:12 kris wrote: with sqlalchemy 0.4.1, Is there an idiom for delete the children of the object without actually deleting the object itself? I tried session.delete (obj) session.flush() # add new children session.save (obj) session.flush() But it

[sqlalchemy] IMPORTANT: Does SA caches objects in memory forever?

2007-12-06 Thread Arun Kumar PG
Hi All, I am having this problem with memory consumption when using SA. I have 200 MB ram allocated for the application and when I look at the usage statistics using top or any other memory monitor I see that after every request to the application the memory consumption is increasing and the

[sqlalchemy] Re: IMPORTANT: Does SA caches objects in memory forever?

2007-12-06 Thread Arun Kumar PG
FYI: I am using SA 0.3.9. On Dec 6, 2007 6:52 PM, Arun Kumar PG [EMAIL PROTECTED] wrote: Hi All, I am having this problem with memory consumption when using SA. I have 200 MB ram allocated for the application and when I look at the usage statistics using top or any other memory monitor I

[sqlalchemy] Re: concurent modification

2007-12-06 Thread imgrey
i can only make comments about fragments like this but i cant address your full design issue since you havent supplied a fully working illustration of what it is youre trying to do. the daemon: http://dpaste.com/hold/27089/ and required utils.py modele: http://dpaste.com/hold/27092/ it

[sqlalchemy] Re: IMPORTANT: Does SA caches objects in memory forever?

2007-12-06 Thread Michael Bayer
the session in 0.3 holds onto objects until they are explicitly removed using session.clear() or session.expunge(). as a super quick fix you can use the weak_identity_map flag with the 0.3 session which will change the identity map to be weak referencing. however, objects which are marked

[sqlalchemy] Re: Filling foreign key with mapping

2007-12-06 Thread paftek
Thanks for these interesting articles. I was blind ! Why using a small integer surrogate primary key instead of two chars primary key, why ? =) As described in the article, I think I am abusing of surrogate primary keys. Our database schema is not yet finalized, I am going to fix this right now.

[sqlalchemy] Re: IMPORTANT: Does SA caches objects in memory forever?

2007-12-06 Thread Rick Morrison
If I recall, your application is using localthread strategy and scoped_session(), doesn't it? Doesn't scoped_session() collect references from otherwise transient Session()'s and hold on to them between calls? --~--~-~--~~~---~--~~ You received this message because

[sqlalchemy] Re: Filling foreign key with mapping

2007-12-06 Thread Michael Bayer
eh, i use surrogate keys all the time :) On Dec 6, 2007, at 4:45 AM, paftek wrote: Thanks for these interesting articles. I was blind ! Why using a small integer surrogate primary key instead of two chars primary key, why ? =) As described in the article, I think I am abusing of surrogate

[sqlalchemy] UNION of Query objects

2007-12-06 Thread Artur Siekielski
Hi. I know that I can do SQL UNION of two record sets when using SQL Expression objects. But how to do UNION of two sqlalchemy.orm.Query objects? I can do the UNION on SQL Expressions level and then use 'from_statement' from Query, but what I can do if I already have two Queries?

[sqlalchemy] Re: concurent modification

2007-12-06 Thread Michael Bayer
On Dec 6, 2007, at 8:57 AM, imgrey wrote: i can only make comments about fragments like this but i cant address your full design issue since you havent supplied a fully working illustration of what it is youre trying to do. the daemon: http://dpaste.com/hold/27089/ and required utils.py

[sqlalchemy] Re: UNION of Query objects

2007-12-06 Thread Michael Bayer
On Dec 6, 2007, at 11:41 AM, Artur Siekielski wrote: Hi. I know that I can do SQL UNION of two record sets when using SQL Expression objects. But how to do UNION of two sqlalchemy.orm.Query objects? I can do the UNION on SQL Expressions level and then use 'from_statement' from Query, but

[sqlalchemy] Re: Representation of boolean logic in a database

2007-12-06 Thread Paul Johnston
Hi, My problem is beeing able to represent and store relations between options and contents tables in a normalized way. I'd probably just store the relationship as a string. Do you have any particular querying requirements? Sometimes pragmatism beats elegance. Paul

[sqlalchemy] Re: UNION of Query objects

2007-12-06 Thread Artur Siekielski
Hi. I know that I can do SQL UNION of two record sets when using SQL Expression objects. But how to do UNION of two sqlalchemy.orm.Query objects? I can do the UNION on SQL Expressions level and then use 'from_statement' from Query, but what I can do if I already have two Queries?

[sqlalchemy] Re: delete children of object w/o delete of object?

2007-12-06 Thread kris
That's what I am looking for, since the ORM is able to find all the children of a deleted object, I thought I might use the same functionality to find all the children on the object and delete them directly. On Dec 6, 2:55 am, svilen [EMAIL PROTECTED] wrote: On Wednesday 05 December 2007

[sqlalchemy] SA 0.4.1 and MS-SQL problem at create time

2007-12-06 Thread Christophe de Vienne
Hi all, Since SQLAlchemy 0.4.1, I cannot create my database anymore on mssql only (mysql and sqlite are fine). The error is the following : File /usr/lib/python2.4/site-packages/SQLAlchemy-0.4.1-py2.4.egg/ sqlalchemy/databases/mssql.py, line 945, in get_column_specification if (not

[sqlalchemy] Re: SA 0.4.1 and MS-SQL problem at create time

2007-12-06 Thread Paul Johnston
Hi, It seems that the mssql backend use a 'foreign_key' attribute on Column which does not exist anymore. Yes, it's now foreign_keys. This is fixed in the svn trunk. I still need to sort out a way to have MSSQL unit tests run periodically, so we can pick up this kind of issue before

[sqlalchemy] Re: SA 0.4.1 and MS-SQL problem at create time

2007-12-06 Thread Rick Morrison
column.foreign_key is now a list: foreign_keys[]. Trunk looks correct and should work. Works here. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to

[sqlalchemy] Re: SA 0.4.1 and MS-SQL problem at create time

2007-12-06 Thread Rick Morrison
I still need to sort out a way to have MSSQL unit test periodically I'm still planning on hosting a buildbot as I promised some months (how embarassing) ago. The first one will be Linux + pymssql, but once I get the new VMware host provisioned out here, I can put up a Windows + pyodbc host too.

[sqlalchemy] Re: delete children of object w/o delete of object?

2007-12-06 Thread Michael Bayer
i would think a regular cascade=all, delete-orphan configuration would make this quite simple. http://www.sqlalchemy.org/docs/04/session.html#unitofwork_cascades --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[sqlalchemy] Re: SA 0.4.1 and MS-SQL problem at create time

2007-12-06 Thread Christophe de Vienne
Hi Paul, On 6 déc, 19:31, Paul Johnston [EMAIL PROTECTED] wrote: Hi, It seems that the mssql backend use a 'foreign_key' attribute on Column which does not exist anymore. Yes, it's now foreign_keys. This is fixed in the svn trunk. Thanks ! I still need to sort out a way to have MSSQL

[sqlalchemy] Re: delete children of object w/o delete of object?

2007-12-06 Thread kris
I am using exactly that configuration. However, I wish to delete just the children objects and I have been unable to do session.delete(o);session.flush(); o.kids = ... session.save(o) which I expected to remove the object o and all the kids, then re- insert o with the new kids. On Dec 6, 10:43

[sqlalchemy] Re: delete children of object w/o delete of object?

2007-12-06 Thread Michael Bayer
heya - Remove the children from the collection, set the new children onto it, and then flush; they'll be deleted. you can just say parent.children = [newobj1, newobj2, newobj3]. the removed children get deleted and the new children get added. session.delete(obj) does not change the status of

[sqlalchemy] Re: IMPORTANT: Does SA caches objects in memory forever?

2007-12-06 Thread Felix Schwarz
Michael Bayer schrieb: in version 0.4, the session is weak referencing so that objects which are not elsewhere referenced (and also are not marked as dirty or deleted) fall out of scope automatically. that is documented at: