views:

345

answers:

2

I'm trying to add two new object using session.add(object) twice..but the first object disappear on session.commit()...why it happens?

A: 

they must be of different object for them to be added to the session.commit().

b3rx
it was a different object..ok, let say this is sample of my code: // assume the session and all python module have been imported beforeobj1 = object1()obj2 = object2()obj1.fullname = 'fullname'obj1.lastname = 'lastname'obj2.city = 'city'obj2.state = 'state'session.add_all([obj1, obj2])try: session.commit()except: session.rollback()// this was ok in sqlalchemy v0.5.3, but it face problem in v0.5.5// the first object was missing when session.commit() is called
well it looks like you forgot that very crucial detail from your OP. If you could have added that to your OP, it would make life for others a lot easier. And as zzzeek have mentioned, try posting that information to sqlalchemy's mailing-loist.
b3rx
A: 

if the difference between 0.5.3 and 0.5.5 is all that changes, you probably want to create a fully illustrating example and post it on the mailing list at http://groups.google.com/group/sqlalchemy/ .

zzzeek

related questions