[sqlalchemy] MySql has gone away

2009-04-15 Thread reetesh nigam
Hi All, I was getting My Sql has gone away, then i set sqlalchemy.pool_recylce=3600 in prod.cfg. it was woking fine but but still some time i get the same error i.e MySql has gone away. Can any one tell me what should i do? Thanks anD Regards Reetesh Nigam --~--~-~--~~---

[sqlalchemy] Re: using for_update returns stale data if old row already exists in identity_map

2009-04-15 Thread Michael Bayer
On Apr 15, 2009, at 8:57 PM, dykang wrote: > > ah, but since the ORM actually is forced to execute the query anyway, > why not update the object in the identity map with the correct data, > and raise an exception if the current object is dirty? It seems bad > procedure > to be loading an object

[sqlalchemy] Re: using for_update returns stale data if old row already exists in identity_map

2009-04-15 Thread dykang
On Apr 15, 5:37 pm, Michael Bayer wrote: > On Apr 15, 2009, at 8:13 PM, dykang wrote: > > > > > > > The following code is a simple reproduction of the issue. > > > # create your metadata and session > > import sqlalchemy > > > table = sqlalchemy.Table ( > >        'test_table', meta, > >      

[sqlalchemy] Re: using for_update returns stale data if old row already exists in identity_map

2009-04-15 Thread Michael Bayer
On Apr 15, 2009, at 8:13 PM, dykang wrote: > > The following code is a simple reproduction of the issue. > > # create your metadata and session > import sqlalchemy > > table = sqlalchemy.Table ( >'test_table', meta, >sqlalchemy.Column('id', sqlalchemy.Integer, primary_key=True),

[sqlalchemy] Re: Mapping and reflection question

2009-04-15 Thread Michael Bayer
On Apr 15, 2009, at 6:43 PM, thatsanicehatyouh...@mac.com wrote: > > Hello, > > I have a question about SQLAlchemy (well, I have a lot of questions, > but I'll try to space them out a bit!). I'm very new to it (and > python) but not databases and ORMs. > > I like that I can use reflection to def

[sqlalchemy] using for_update returns stale data if old row already exists in identity_map

2009-04-15 Thread dykang
The following code is a simple reproduction of the issue. # create your metadata and session import sqlalchemy table = sqlalchemy.Table ( 'test_table', meta, sqlalchemy.Column('id', sqlalchemy.Integer, primary_key=True), sqlalchemy.Column('foo', sqlalchemy.Integer),

[sqlalchemy] Mapping and reflection question

2009-04-15 Thread thatsanicehatyouhave
Hello, I have a question about SQLAlchemy (well, I have a lot of questions, but I'll try to space them out a bit!). I'm very new to it (and python) but not databases and ORMs. I like that I can use reflection to define tables, and I really want to use that since I don't want to update pyth

[sqlalchemy] Re: Advice on integrating Alchemy with a caching mechanism such as Shove

2009-04-15 Thread phrrn...@googlemail.com
Beautiful. I am impressed at the elegance of this sample and the others also. pjjH On Apr 15, 3:26 pm, "Michael Bayer" wrote: > for SQLA integration you'd probably build this into the Session/Query, > which is most easily accomplished by subclassing Query.   some examples > are in the distribu

[sqlalchemy] Re: deferred columns can't be added to declarative class after creation?

2009-04-15 Thread Michael Bayer
heres a patch for that: Index: lib/sqlalchemy/ext/declarative.py === --- lib/sqlalchemy/ext/declarative.py (revision 5902) +++ lib/sqlalchemy/ext/declarative.py (working copy) @@ -552,6 +552,12 @@ _undefer_column

[sqlalchemy] deferred columns can't be added to declarative class after creation?

2009-04-15 Thread scott
Hi- I'm trying to add a deferred column to a declarative class after the class has been created (but before tables are created, obviously). This works fine with none-deferred columns, as documented on declarative.py:48, but deferred columns added in this way don't get added to the table definitio

[sqlalchemy] Re: Advice on integrating Alchemy with a caching mechanism such as Shove

2009-04-15 Thread Michael Bayer
for SQLA integration you'd probably build this into the Session/Query, which is most easily accomplished by subclassing Query. some examples are in the distribution in examples/query_caching. I use a variant of the "with_cache_key" version for my own purposes. phrrn...@googlemail.com wrote:

[sqlalchemy] Advice on integrating Alchemy with a caching mechanism such as Shove

2009-04-15 Thread phrrn...@googlemail.com
Hi, I would like to export a 'lookup' interface to programmers that does object caching (a bounded size cache with a LRU replacement policy) and prefetching of small tables for read-only reference data. This is a rewrite in Python over SQL Alchemy of similar functionality in Perl (originally imple

[sqlalchemy] Re: inheritance problem

2009-04-15 Thread Julien Cigar
On Tue, 2009-04-14 at 20:58 -0400, Michael Bayer wrote: > if joined table inheritance can't figure out the join condition between > the two tables, use the "inherit_condition" argument to mapper() which > works similarly to primaryjoin on relation(). > it works with inherit_condition, thanks !