[sqlalchemy] Re: app memory leak - execute() with SA 0.5.2, PG 8.3, Psycopg2

2009-02-25 Thread Allen Bierbaum
in my cases and speeds up the system dramatically. Once I understood that there wasn't really a memory leak, I just optimized what was already there to use less memory. -Allen On Wed, Feb 25, 2009 at 6:59 PM, Peter Hansen pe...@engcorp.com wrote: Allen Bierbaum wrote: On Tue, Feb 24, 2009 at 4

[sqlalchemy] Re: app memory leak - execute() with SA 0.5.2, PG 8.3, Psycopg2

2009-02-24 Thread Allen Bierbaum
On Tue, Feb 24, 2009 at 4:44 AM, Chris Miles miles.ch...@gmail.com wrote: On Feb 22, 6:08 am, Allen Bierbaum abierb...@gmail.com wrote: The python process.  The number of objects seems to remain fairly controlled.  But the amount of resident memory used by the python process does not decrease

[sqlalchemy] app memory leak - execute() with SA 0.5.2, PG 8.3, Psycopg2

2009-02-21 Thread Allen Bierbaum
Hello all: We are running into a very strange memory leak issue. Here are the details: - The co executes select statements directly on a table using SA 0.5.2, Postgres 8.3, Psycopg2, all running on Linux (Ubuntu 8.04) - Querying a table with approximately 7 records - When we query the

[sqlalchemy] Re: app memory leak - execute() with SA 0.5.2, PG 8.3, Psycopg2

2009-02-21 Thread Allen Bierbaum
topped out even though all handles to the results have been cleared in python. I am sure that I must be doing something very wrong, but I can't figure it out. Can anyone point out my error? -Allen On Sat, Feb 21, 2009 at 7:52 AM, Allen Bierbaum abierb...@gmail.com wrote: Hello all: We

[sqlalchemy] Re: app memory leak - execute() with SA 0.5.2, PG 8.3, Psycopg2

2009-02-21 Thread Allen Bierbaum
generally stays large once it grows. On Feb 21, 2009, at 11:16 AM, Allen Bierbaum wrote: I spent some more time and came up with a completely standalone test application. (attached) (requires SA 0.5.2 and some database backend). I have tested this with postgres and with sqlite and both

[sqlalchemy] Re: Using deferred with declarative

2008-11-14 Thread Allen Bierbaum
Does anyone have any ideas on this? Does declarative simply not support the deferred property? -Allen On Sat, Nov 8, 2008 at 11:32 AM, Allen Bierbaum [EMAIL PROTECTED] wrote: We have been using the declarative successfully in our codebase for a couple months now with 0.4.x, but we have just

[sqlalchemy] Re: Using deferred with declarative

2008-11-14 Thread Allen Bierbaum
Bierbaum Sent: 14 November 2008 16:40 To: sqlalchemy Subject: [sqlalchemy] Re: Using deferred with declarative Does anyone have any ideas on this? Does declarative simply not support the deferred property? -Allen On Sat, Nov 8, 2008 at 11:32 AM, Allen Bierbaum [EMAIL PROTECTED] wrote

[sqlalchemy] Using deferred with declarative

2008-11-08 Thread Allen Bierbaum
We have been using the declarative successfully in our codebase for a couple months now with 0.4.x, but we have just run into a problem. We have a table we we want to map using declarative but we want to have one of the columns be deferred because it contains binary data. Unfortunately we can't

[sqlalchemy] Re: Is inserting new data with column_mapped_collection inconsistent?

2008-05-17 Thread Allen Bierbaum
On Fri, May 16, 2008 at 4:54 PM, jason kirtland [EMAIL PROTECTED] wrote: [..] Anyway, I think this is a bit non-intuitive. What I propose instead is that SA could automatically set the 'keyword' attribute of the Note object as part of the process of assigning it to the mapped collection

[sqlalchemy] Is inserting new data with column_mapped_collection inconsistent?

2008-05-16 Thread Allen Bierbaum
I have just started using column_mapped_collections. (http://www.sqlalchemy.org/docs/04/mappers.html#advdatamapping_relation_collections_dictcollections I must say, these are very powerful and extremely nice when reading data. But I have run into one thing that seems confusing when it comes to

[sqlalchemy] Challenging relationship: many-to-many, custom join, mapped dictionary, can it work???

2008-05-15 Thread Allen Bierbaum
I am trying to setup a many-to-many relationship for two tables where I would like to allow more natural access to the data using a dictionary interface. The exact usage is pretty complex to explain, but I have come up with a simple example that demonstrates the same concept. (there is a full

[sqlalchemy] Re: Challenging relationship: many-to-many, custom join, mapped dictionary, can it work???

2008-05-15 Thread Allen Bierbaum
On Thu, May 15, 2008 at 11:37 AM, Michael Bayer [EMAIL PROTECTED] wrote: On May 15, 2008, at 11:23 AM, Allen Bierbaum wrote: # WOULD LIKE - # # Can this be done using # - Custom join condition on input_output_type # - column_mapped_collection # it can be done. Try working

[sqlalchemy] Re: Using declarative when imports happen before create_engine() ??

2008-05-05 Thread Allen Bierbaum
the declarative layer and have it regenerate all automatically created metadata and mappers? -Allen On Mon, Apr 28, 2008 at 5:07 PM, Michael Bayer [EMAIL PROTECTED] wrote: On Apr 28, 2008, at 5:42 PM, Allen Bierbaum wrote: So, if I understand this right, I could import a base module

[sqlalchemy] Re: Using declarative when imports happen before create_engine() ??

2008-05-05 Thread Allen Bierbaum
On Mon, May 5, 2008 at 4:29 PM, Michael Bayer [EMAIL PROTECTED] wrote: On May 5, 2008, at 5:04 PM, Allen Bierbaum wrote: Is there some way to clear the declarative layer and have it regenerate all automatically created metadata and mappers? not as of yet but this could be done

[sqlalchemy] Re: Using declarative when imports happen before create_engine() ??

2008-04-28 Thread Allen Bierbaum
and bind the metadata for the Base class to an engine for use. Correct? (I apologize if I used the terms incorrectly). If this is true, then I think I see how I can solve my problem. -Allen On Sun, Apr 27, 2008 at 6:28 PM, Michael Bayer [EMAIL PROTECTED] wrote: On Apr 27, 2008, at 8:25 AM, Allen

[sqlalchemy] Using declarative when imports happen before create_engine() ??

2008-04-27 Thread Allen Bierbaum
I am investigating the use of the declarative extension. It looks very attractive, but I have a problem... I have a large project that is using the standard methods of configuring tables and mappers. More specifically, there is a single method in my domain package that is called once the

[sqlalchemy] Schema Display recipe

2008-01-17 Thread Allen Bierbaum
I was just taking a look at the recipes on the SA wiki and stumbled across this one: http://www.sqlalchemy.org/trac/wiki/UsageRecipes/SchemaDisplay It is a pretty nice little piece of code to automatically create schema diagrams from a DB engine and UML diagrams for a set of mappers. I am very

[sqlalchemy] Re: Schema Display recipe

2008-01-17 Thread Allen Bierbaum
Thanks, that worked great. Have their been any new capabilities added to this code? -Allen On Jan 17, 2008 12:21 PM, [EMAIL PROTECTED] wrote: use sqlalchemy.orm.class_mapper(cls) instead of cls.mapper, and it should work? Allen Bierbaum wrote: I was just taking a look at the recipes

[sqlalchemy] Re: Sessions and threads, find in one thread, use in another

2007-12-15 Thread Allen Bierbaum
On Dec 13, 2007 12:29 PM, Allen Bierbaum [EMAIL PROTECTED] wrote: On Dec 13, 2007 10:47 AM, Michael Bayer [EMAIL PROTECTED] wrote: On Dec 13, 2007, at 9:55 AM, Allen Bierbaum wrote: In my current application I am running a rather expensive query in a background thread, but then I need

[sqlalchemy] Sessions and threads, find in one thread, use in another

2007-12-13 Thread Allen Bierbaum
In my current application I am running a rather expensive query in a background thread, but then I need to use the results in the foreground thread. The object I find has a great deal of lazy evaluated properties that link it to several other mapped objects. As it stands now, the application is

[sqlalchemy] Re: Sessions and threads, find in one thread, use in another

2007-12-13 Thread Allen Bierbaum
On Dec 13, 2007 10:47 AM, Michael Bayer [EMAIL PROTECTED] wrote: On Dec 13, 2007, at 9:55 AM, Allen Bierbaum wrote: In my current application I am running a rather expensive query in a background thread, but then I need to use the results in the foreground thread. The object I find

[sqlalchemy] Re: Possible to build a query object from a relation property?

2007-12-10 Thread Allen Bierbaum
Thanks. This looks like it should work. I will give it a try. -Allen On Dec 9, 2007 10:39 PM, Michael Bayer [EMAIL PROTECTED] wrote: On Dec 9, 2007, at 10:55 PM, Allen Bierbaum wrote: I am using SA 0.3.11 and I would like to know if there is a way to get a query object from

[sqlalchemy] Question about using python expressions to create a GIS query

2007-12-10 Thread Allen Bierbaum
I am trying to figure out how to best use SA to create a GIS query. In my application I am actually using ORM objects and mappers, but to keep my question focused on clauses and python expressions, I am just trying to test this out without the ORM first. The SQL query I would like to generate is

[sqlalchemy] Possible to build a query object from a relation property?

2007-12-09 Thread Allen Bierbaum
I am using SA 0.3.11 and I would like to know if there is a way to get a query object from a relation property. I have several one-to-many relationships in my application. These are all setup and work very well, but I find that I often want to perform further filtering of the objects in the

[sqlalchemy] Re: Question about an ORM query with an aggregate function

2007-12-07 Thread Allen Bierbaum
I forgot to mention, I am using SA 0.3.10. Thanks, Allen On Dec 7, 2007 7:49 AM, Allen Bierbaum [EMAIL PROTECTED] wrote: I am trying to create two queries with some of my SA ORM objects that will use the sum of a field found through a relationship. To be a bit more concrete, here

[sqlalchemy] Question about an ORM query with an aggregate function

2007-12-07 Thread Allen Bierbaum
I am trying to create two queries with some of my SA ORM objects that will use the sum of a field found through a relationship. To be a bit more concrete, here is a simple setup similar to mine. # table object users_table = Table('users', meta, Column('user_id', Integer, primary_key=True),

[sqlalchemy] Re: Question about an ORM query with an aggregate function

2007-12-07 Thread Allen Bierbaum
Thanks for the feedback. I hadn't thought of doing it this way. I did comb through the documentation a 2nd and 3rd time today though and found the add_column() method for queries. It looks like that may be another way to get what I want. I am thinking about even creating a little builder

[sqlalchemy] Future of migrate project

2007-06-27 Thread Allen Bierbaum
Is anyone currently keeping the migrate project up to date or are there any other efforts to provide similar functionality? We have a rather large project where we started using migrate with SA because we wanted a robust way to track database modifications and apply then to production databases.

[sqlalchemy] Re: Spatial data (PostGIS/OGC) with SqlAlchemy

2007-02-27 Thread Allen Bierbaum
this directly with SA, so if anyone can tell me a way to let SA know exactly how I want the object's value to appear in the generated SQL statement please let me know so I can refine my code. Thanks, Allen On 2/25/07, Allen Bierbaum [EMAIL PROTECTED] wrote: [snip] When I use this with my table

[sqlalchemy] Re: Spatial data (PostGIS/OGC) with SqlAlchemy

2007-02-25 Thread Allen Bierbaum
I have been pursuing this further on my own and one of the issues I have run into is how to cleanly add a geometry column to a database. The posting referenced in the first e-mail [2] talks about doing this directly with psycopg2 cursor because the poster could not get it working with SA. I gave

[sqlalchemy] Re: Spatial data (PostGIS/OGC) with SqlAlchemy

2007-02-25 Thread Allen Bierbaum
[snip] When I use this with my table and datamapper code, it looks like everything is working fine but the generated SQL insert statement fails with a exception: sqlalchemy.exceptions.SQLError: (ProgrammingError) parse error - invalid geometry 'INSERT INTO gis_entity (id, name, pos)

[sqlalchemy] Tracking changes on mapped entities

2007-02-12 Thread Allen Bierbaum
Is it possible to examine the session and get a list of all mapped instances that have been changed? More details: I would like to implement an observer pattern in my application. I would like to let the code make changes to mapped objects as normal, but immediately before (or after) a session

[sqlalchemy] Re: Unit testing with SA?

2007-02-07 Thread Allen Bierbaum
in the SA tutorial. This may help separate the SA plugin magic from the fixture magic. Anyway, see below for more detailed comments On 2/6/07, Kumar McMillan [EMAIL PROTECTED] wrote: On 2/3/07, Allen Bierbaum [EMAIL PROTECTED] wrote: This works for creating the table structure

[sqlalchemy] Re: Unit testing with SA?

2007-02-07 Thread Allen Bierbaum
I am going to try to integrate this into my testing framework this afternoon so I am sure I will have more questions after that. In the meantime see below... On 2/7/07, Kumar McMillan [EMAIL PROTECTED] wrote: Thanks for taking a close look Allen. Here are some answers... On 2/7/07, Allen

[sqlalchemy] Re: Anyone using migrate?

2007-02-01 Thread Allen Bierbaum
On 2/1/07, Evan Rosson [EMAIL PROTECTED] wrote: I was considering the use of migrate (http://erosson.com/migrate/) for a new project using SA and I just wondered if anyone else is using it? I'm using it, but then, I wrote it. It's worked well for me, though I'm not sure how widely used

[sqlalchemy] Re: Persistence Layer best practices with SQLAlchemy

2007-01-27 Thread Allen Bierbaum
On 1/26/07, Michael Bayer [EMAIL PROTECTED] wrote: On Jan 25, 7:28 pm, Allen [EMAIL PROTECTED] wrote: The basic idea of a persistence layer (as I understand it) is that you attempt to isolate applications from the database to the point that the application and the data model can vary