AFIK, all db operations are using Session, and I am not doing any 
alters, etc, only selects.

I finally did get the errors while logging was enabled, but not sure 
what sort of light has been shed on this:

snippet:

2007-11-08 05:44:44,336 INFO sqlalchemy.engine.base.Engine.0x..8c BEGIN
2007-11-08 05:44:44,339 INFO sqlalchemy.engine.base.Engine.0x..8c SELECT 
kwrelation.id AS kwrelation_id, kwrelation.quote_id AS 
kwrelation_quote_id, kwrelation.keyword_id AS kwrelation_keyword_id
FROM kwrelation
WHERE %s = kwrelation.quote_id ORDER BY kwrelation.id
2007-11-08 05:44:44,340 INFO sqlalchemy.engine.base.Engine.0x..8c ['a%']
2007-11-08 05:44:44,341 INFO sqlalchemy.engine.base.Engine.0x..8c SELECT 
count(quote.authorkey)
FROM quote
WHERE quote.authorkey = %s
2007-11-08 05:44:44,340 INFO sqlalchemy.engine.base.Engine.0x..8c [513L]
Exception _mysql_exceptions.ProgrammingError: (2014, "Commands out of 
sync; you can't run this command now") in <bound method Cursor.__del__ 
of <MySQLdb.cursors.Cursor object at 0x8bf692c>> ignored
2007-11-08 05:44:44,341 INFO sqlalchemy.engine.base.Engine.0x..8c 
['Nicola_Abbagnano']
2007-11-08 05:44:44,347 INFO sqlalchemy.engine.base.Engine.0x..8c SELECT 
author.lastname
FROM author
WHERE author.lastname LIKE %s ORDER BY author.lastname, author.firstname
  LIMIT 20, 1


Mike Orr wrote:
> On Nov 7, 2007 8:26 PM, David Geller <[EMAIL PROTECTED]> wrote:
>> Mike Orr wrote:
>>> Are you using SQLAlchemy's ORM, SQL builder, or both?
>>>
>> BOTH
> 
> Are you using Session.execute() for your non-ORM queries?  Anything
> else can cause the session cache to get out of sync with the database.
>  Are you doing any non-transactional queries like "ALTER TABLE"?
> Those will commit a transaction without telling the ORM.
> 
>>> Have you turned on SQL logging and connection pool logging?  What are
>>> the last couple queries executed before this happens?
>>>
>> I tried this - but wouldn't you know it, with logging the error doesn't
>> appear! If I turn off the logging, the error *does* appear
>> (occasionally). So I am not sure what to do at this point...
> 
> Are you getting log messages?  If not, you may have to set level=DEBUG
> in the sqlalchemy logger or root logger.
> 

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to