But, is my design mistake ?
I must use ever save_or_update() function?
In my case, I have two process working over the same "class of
bussines object".
I do a query, which return me an object list and I call to other
function which pass one parameter (id) and this function do other
query over the same class.
i.e.:
Table -> Person
person_list = my_service.get_people()
for p in person_list:
process_person(p.id)
....
def process_person(id):
person = my_service.get_person()
....
do something with person
....
session.save(person) # here, raise exception:
InvalidRequestError: Instance... already persistent
session.flush([person])
Now, I chage session.save_or_update(person), and this work fine.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---