[sqlalchemy] Re: Can't shake off the 'MySQL server has gone away' Error

2008-08-18 Thread Alen Ribic
I still seem to get the 'MySQL server has gone away' Error. I am suspecting that the problem is in my use of FCGI in production. Thats the only difference between my Development environment and Production and it works 100% without the error in Development env. I guess I'll have to put some more

[sqlalchemy] Re: How to deal with simple python subclasses and the declarative extension?

2008-08-18 Thread Michael Bayer
On Aug 17, 2008, at 10:18 PM, Russell Warren wrote: After struggling with this a lot longer I've realized that my subclassing problem is fundamentally simpler than I've described. My application generates the database from scratch. I use declarative to avoid having to define the database

[sqlalchemy] Re: Can't shake off the 'MySQL server has gone away' Error

2008-08-18 Thread Michael Bayer
On Aug 18, 2008, at 5:08 AM, Alen Ribic wrote: sql.py class SQLAlchemyMiddleware(object): Middleware for providing clean SQLAlchemy Session objects for each Request. def __init__(self, application): self.application =

[sqlalchemy] Re: Can't shake off the 'MySQL server has gone away' Error

2008-08-18 Thread Alen Ribic
The way you have it, a concurrent thread can easily interrupt the ScopedSession instance attached to meta and replace with a new one, with the old one being lost. Ouch, that would be no good. Thank goodness my prod env aint really prod yet. Thank you for your help again. Much appreciated.

[sqlalchemy] sqlalchemy 0.4 and multiple database binds

2008-08-18 Thread Ross Vandegrift
Hello everyone, According to the Pylons wiki docs on multiple engines with SQLALchemy 0.4, I should be able to do: def init_model(default_engine, alternate_engine): binds = { 'tableA': default_engine, 'tableB': alternate_engine } meta.session =

[sqlalchemy] Re: sqlalchemy 0.4 and multiple database binds

2008-08-18 Thread Michael Bayer
On Aug 18, 2008, at 10:07 AM, Ross Vandegrift wrote: Hello everyone, According to the Pylons wiki docs on multiple engines with SQLALchemy 0.4, I should be able to do: def init_model(default_engine, alternate_engine): binds = { 'tableA': default_engine, 'tableB':

[sqlalchemy] Re: Can't shake off the 'MySQL server has gone away' Error

2008-08-18 Thread jason kirtland
Alen Ribic wrote: I still seem to get the 'MySQL server has gone away' Error. I am suspecting that the problem is in my use of FCGI in production. Thats the only difference between my Development environment and Production and it works 100% without the error in Development env. I guess

[sqlalchemy] Re: sqlalchemy 0.4 and multiple database binds

2008-08-18 Thread Ross Vandegrift
On Mon, Aug 18, 2008 at 10:14:44AM -0400, Michael Bayer wrote: On Aug 18, 2008, at 10:07 AM, Ross Vandegrift wrote: Hello everyone, According to the Pylons wiki docs on multiple engines with SQLALchemy 0.4, I should be able to do: def init_model(default_engine, alternate_engine):

[sqlalchemy] AttributeError: 'property' object has no attribute 'impl'

2008-08-18 Thread Brad Wells
I receive the following error with SA 0.4.7p1 and the latest 0.4 svn revision. AttributeError: 'property' object has no attribute 'impl' Mappers == mapper(TransactionType, transaction_types) transactions_mapper = mapper(Transaction, transactions, order_by=transactions.c.date,

[sqlalchemy] Re: AttributeError: 'property' object has no attribute 'impl'

2008-08-18 Thread Michael Bayer
it has to do with a name conflict between a regular python property you've configured somewhere, and the name of a mapped attribute or relation(). The descriptors which SQLAlchemy places on the class (InstrumentedAttribute) have an impl attribute. You'd have to find what name is

[sqlalchemy] Re: tracking parents, names

2008-08-18 Thread Martijn Faassen
Hey Michael, Thanks for the helpful answer. Michael Bayer wrote: [snip] (after I've reread the above two paragraphs many times it seems like the idea is that the target object doesn't know anything about the name of the relation in which its collected). The idea is that if the object

[sqlalchemy] Re: tracking parents, names

2008-08-18 Thread Michael Bayer
On Aug 18, 2008, at 11:42 AM, Martijn Faassen wrote: The idea is that if the object graph says: foo.bar.baz that'll be: bar.__name__ == 'bar' bar.__parent__ is foo baz.__name__ == 'baz' baz.__parent__ is bar In this case: foo.bar[key] it'll be: bar[key].__parent__ is foo.bar

[sqlalchemy] Re: SQLAlchemy getting slow when do a lots of things in transaction

2008-08-18 Thread Victor Lin
I found that it seems not the transaction cause the performance problem. I think it maybe cause by use one session for a long time. Performance getting slower with the program run longer time. Once I stop the program and run it again, at first it works fast. So I think it is the problem of using

[sqlalchemy] Re: SQLAlchemy getting slow when do a lots of things in transaction

2008-08-18 Thread Michael Bayer
On Aug 18, 2008, at 1:02 PM, Victor Lin wrote: I found that it seems not the transaction cause the performance problem. I think it maybe cause by use one session for a long time. Performance getting slower with the program run longer time. Once I stop the program and run it again, at

[sqlalchemy] Elixir 0.6.1 released!

2008-08-18 Thread Gaetan de Menten
I am very pleased to announce that version 0.6.1 of Elixir (http://elixir.ematia.de) is now available. As always, feedback is very welcome, preferably on Elixir mailing list. This is a minor release featuring some bug fixes (one of them to handle a late rename in SQLAlchemy's 0.5 beta cycle), a

[sqlalchemy] Multiple Foreign Keys

2008-08-18 Thread Ally
Hi all, I’m fairly new to DBs and SQA and I’m having a few issues with multiple foreign keys. Essentially, I have a “Character” table with Character IDs and their associated name, and a Stats table, with containing data about various events, with two separate columns both with FKs to the

[sqlalchemy] Re: Multiple Foreign Keys

2008-08-18 Thread Michael Bayer
On Aug 18, 12:30 pm, Ally [EMAIL PROTECTED] wrote: Hi all, I’m fairly new to DBs and SQA and I’m having a few issues with multiple foreign keys. Essentially, I have a “Character” table with Character IDs and their associated name, and a Stats table, with containing data about various

[sqlalchemy] Re: SQLAlchemy getting slow when do a lots of things in transaction

2008-08-18 Thread Victor Lin
Finally, I found the real reason of performance problem. There is a pickle filed in my table. SQLAlchemy update all rows every query. That's why it is so slow. By following the guide of FAQ, I have solved that problem. Thanks your help. Victor Lin. On 8月19日, 上午1時16分, Michael Bayer [EMAIL

[sqlalchemy] Re: Elixir 0.6.1 released!

2008-08-18 Thread Jose Galvez
I'm not trying to be an ass, but what are the advantages to using Elixer over using the declarative syntax such as: from sqlalchemy import * from sqlalchemy.orm import relation, scoped_session, sessionmaker from sqlalchemy.ext.declarative import declarative_base dbe =