Dear all,

I am updating records using sqlalchemy in pylons framework. If I call
select query it wont get updated records. some times I will get
correct results and some times it will not get. the results I am
getting is inconsistent. I have tried all session methods to get new
record but no success plz help me on this.
If I call Session.rollback() I will get correct results. I think
calling Session.rollback() not a good idea.
the snippet is as follows
internalId = 1
ProdId = 12345
record = meta.Session.query(model.tab1).filter(model.tab1.INTERNAL_ID
== internalId).one()
if record is not None:
    record.STATUS_ID = 1
    record.PROD_ID = ProdId
    meta.Session.update(record)
   meta.Session.commit()
   meta.Session.merge_all()
   meta.Session.flush()
   meta.Session.expunge_all()

-- 
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