Finally solved the problem. It was caused by the incorrect way I used
Session --

Previously the _q object is central initialized and shared, problem
went away after I create per object instance.

Jerry

On May 19, 11:00 pm, jerryji <[EMAIL PROTECTED]> wrote:
> Hi,
>
> This commit()-not-doing-anything problem is driving me crazy :(
> All my other commits in the same code base are working perfectly,
> it's just this one.
>
> My Session is a scoped_session --
>
> """
> Session = scoped_session(
>         sessionmaker(autoflush=True, transactional=True, ...))
> """
>
> A debug goes --
>
> """
> (Pdb) list
> 277      import pdb; pdb.set_trace()
> 278  ->  item_property = itemproperty_q.filter_by(
> 279              a_itemid=a_itemid, b_itemid=b_itemid,
> 280              propertyid=propertyid,
> 281              userid=userid).first()
> 282      item_property.fav_itemid = fav_itemid
> 283      model.Session.commit()
> (Pdb) n> /item.py(279)compare()
>
> -> a_itemid=a_itemid, b_itemid=b_itemid,
> (Pdb) n> /item.py(280)compare()
>
> -> propertyid=propertyid,
> (Pdb) n> /item.py(281)compare()
>
> -> userid=userid).first()
> (Pdb) n
> """
>
> So far so good, generates lots of output from the select statement.
> The next statement sets item_property.fav_itemid to 10002 from None --
>
> """> /item.py(282)compare()
>
> -> item_property.fav_itemid = fav_itemid
> (Pdb) list
> 277      import pdb; pdb.set_trace()
> 278      item_property = itemproperty_q.filter_by(
> 279              a_itemid=a_itemid, b_itemid=b_itemid,
> 280              propertyid=propertyid,
> 281              userid=userid).first()
> 282  ->  item_property.fav_itemid = fav_itemid
> 283      model.Session.commit()
> (Pdb) item_property.fav_itemid
> (Pdb) fav_itemid
> 10002
> """
>
> But then the next Session.commit() statement does _nothing_ --
>
> """
> (Pdb) n> /item.py(283)compare()
>
> -> model.Session.commit()
> (Pdb) item_property.fav_itemid
> 10002
> (Pdb) n> /item.py(254)compare()
>
> """
>
> I spent much time ripping the mapped table into an IPython session and
> saw it working fine --
>
> """
> In [82]: item_property.fav_itemid = 10002
> In [83]: Session.commit()
> ...<executes the update statement>
> """
>
> What could have gong wrong?
>
> _Many_ thanks in advance!
>
> Jerry
--~--~---------~--~----~------------~-------~--~----~
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