Re: [sqlalchemy] Read-only transactions

2010-11-06 Thread Yang Zhang
Thanks, Michael. We're now doing something similar to your suggestion: monkey-patching Session.flush() to check len(Session.dirty) == 0. This seems to work OK. We can't rely on read-only DB-level users because we also use sqlite for testing purposes, and we'd like to catch errors there too

Re: [sqlalchemy] Read-only transactions

2010-11-06 Thread Michael Bayer
On Nov 6, 2010, at 2:13 PM, Yang Zhang wrote: Thanks, Michael. We're now doing something similar to your suggestion: monkey-patching Session.flush() to check len(Session.dirty) == 0. This seems to work OK. We can't rely on read-only DB-level users because we also use sqlite for testing

[sqlalchemy] Read-only transactions

2010-11-05 Thread Yang Zhang
Hi, we're building an application where we're distinguishing strictly between read-only and read-write transactions, so we'd like to (as a sanity measure) ensure that we're not inadvertently doing any writing from the read-only sections. What's the simplest way to catch writes with sqlalchemy?

Re: [sqlalchemy] Read-only transactions

2010-11-05 Thread Michael Bayer
On Nov 5, 2010, at 8:48 PM, Yang Zhang wrote: Hi, we're building an application where we're distinguishing strictly between read-only and read-write transactions, so we'd like to (as a sanity measure) ensure that we're not inadvertently doing any writing from the read-only sections.