Michael

On Mar 25, 12:33 pm, "Michael Bayer" <[email protected]> wrote:
> nothing ever "refreshes" automatically.  only things that have been 
> "expired", or were never loaded in the first place, are loaded when requested.

Good to know.

> to reduce expirations, 
> readhttp://www.sqlalchemy.org/docs/session.html#committing.

This is exactly what I was looking for, specifically "To disable this
behavior, configure sessionmaker() with expire_on_commit=False."
However, now that I did, things are more complicated, and SQLAlchemy
0.5 complains.

2010-03-25 13:19:02,049 INFO sqlalchemy.engine.base.Engine.0x...f054
BEGIN
2010-03-25 13:19:02,049 INFO sqlalchemy.engine.base.Engine.0x...f054
UPDATE xxx SET yyy=now() WHERE xxx.zzzzz = %s AND xxx.aaaaa = %s
2010-03-25 13:19:02,049 INFO sqlalchemy.engine.base.Engine.0x...f054
[193302, None]
2010-03-25 13:19:02,050 INFO sqlalchemy.engine.base.Engine.0x...f054
ROLLBACK
Traceback (most recent call last):
.
.
.
File "sqlalchemy/orm/mapper.py", line 1401, in _save_obj
sqlalchemy.orm.exc.ConcurrentModificationError: Updated rowcount 0
does not match number of objects updated 1

I will begin to investigate how to avoid that error.  I'd appreciate
any advice or hints.  Also, I would like to know how I prevent
SQLAlchemy from issuing BEGIN and COMMIT statements to the database.
This is a MySQL database with MyISAM tables that have no transaction
support.  This is an overloaded, remote database, and touching it is
expensive.

> Also, if applicable, consider using fewer database-level defaults to populate 
> columns on flush - these values are necessarily read in when you request to 
> see them.

Good to know, but this was not my specific problem.

> To increase what's loaded in a single query is a more elaborate topic which 
> involves the specifics of the mappings you are using.  Usually "eager 
> loading" is the first place to start.  If you're using joined table 
> inheritance, read the mapper docs on configuring "with polymorphic".

Also not my specific problem.

Thanks,
Keith

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" 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/sqlalchemy?hl=en.

Reply via email to