Today I met a strange problem with SqlAlchemy and Postgresql.  The
code is like this:


def update_user(user_id, sess):
    user = sess.query(User).get(user_id).one()

    user.last_activity_time = datetime.now()

    session.commit()   <------------  It hangs here forever.


In the code above, sess is a scoped session.

I don't have any clue of what happened.  In most case the code above
worked.  But suddenly it hangs and any other thread that want to talk
to database after that line is hit are also hanged.  I have to kill
the process.

It does not look like that this a problem of database since after I
restart my application, it works again.

What might cause this kind of problem?

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to