Hi,

I am using version 0.2.8 with Python 2.4.3 and MySQL 4.1.21 on an
up-to-date  Linux Gentoo box

I am having a problem with session.flush(). It seems that every time I
issue a session
flush the DB connection is closed. If I do something like this

eng =
create_engine('mysql://test:[EMAIL PROTECTED]/test',strategy='threadlocal')
conn=eng.connect()
session = create_session(bind_to=conn)
query=session.query(dbPeople)
query=query.select_by_Lastname
listofpeople=query("Doe")
oneguy=listofpeople[0]
oneguy.Country="Namibia"
session.flush()
listofpeople=query("Smith")

The flush works alright and the database is updated, but the last line
result
in an error message:

sqlalchemy.exceptions.InvalidRequestError: This Connection is closed

Is that the normal behaviour? I would have expected the session to
query the DB and return a new list of dbPeople adding them to its list
of "persistent" object. Am I doing something wrong? Misunderstanding
something?

Cheers,
           François


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sqlalchemy
-~----------~----~----~----~------~----~------~--~---

Reply via email to