[sqlalchemy] Re: Transactions and read-only operations

2008-06-08 Thread Tomer
Wow, thanks for the detailed response! That was very helpful (and I'm going to do some more reading now on database transactions in general, and then dig deeper into how SQLAlchemy can use the different options). On Jun 8, 7:23 am, Kyle Schaffrick [EMAIL PROTECTED] wrote: On Sat, 7 Jun 2008

[sqlalchemy] Re: Transactions and read-only operations

2008-06-07 Thread az
On Saturday 07 June 2008 21:35:35 Tomer wrote: 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

[sqlalchemy] Re: Transactions and read-only operations

2008-06-07 Thread Tomer
Thanks. What would happen if I didn't do anything (I've seen lots of examples online that will just issue a query like Session.query(User).all() and that's all). Will that query start a transaction if it's a transactional session? On Jun 7, 11:58 am, [EMAIL PROTECTED] wrote: On Saturday 07 June

[sqlalchemy] Re: Transactions and read-only operations

2008-06-07 Thread az
On Saturday 07 June 2008 22:50:36 Tomer wrote: Thanks. What would happen if I didn't do anything (I've seen lots of examples online that will just issue a query like Session.query(User).all() and that's all). Will that query start a transaction if it's a transactional session? no idea, never

[sqlalchemy] Re: Transactions and read-only operations

2008-06-07 Thread Lukasz Szybalski
On Sat, Jun 7, 2008 at 2:50 PM, Tomer [EMAIL PROTECTED] wrote: Thanks. What would happen if I didn't do anything (I've seen lots of examples online that will just issue a query like Session.query(User).all() and that's all). Will that query start a transaction if it's a transactional

[sqlalchemy] Re: Transactions and read-only operations

2008-06-07 Thread Michael Bayer
On Jun 7, 2008, at 3:50 PM, Tomer wrote: Thanks. What would happen if I didn't do anything (I've seen lots of examples online that will just issue a query like Session.query(User).all() and that's all). Will that query start a transaction if it's a transactional session? when you use the

[sqlalchemy] Re: Transactions and read-only operations

2008-06-07 Thread Tomer
Thanks for the detailed response. I have two follow-up questions: 1) From what I understand, if I read an object (eg, Student) from the database, modify that object or other objects, and then commit, I have no guarantee that the object didn't change between the time I read it and the time I