If I am just issuing a read-only query, and I want to make sure that
nothing will change in the middle, do I need a transaction? If so,
what do I do with it when I'm done - commit or rollback?

For example, I want to do this:

for user in Session.query(User):
    print user.name

Should I use a transaction like this:

Session.begin()
for user in Session.query(User):
    print user.name
Session.commit()

If not, how would I deal with this if my session (created with
scoped_session) is transactional?

Thanks,
Tomer
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
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