Thanks very much for the explanations. > > What would be really nice is a parameter for Session() that would, for > > dialects that support it (it has been in the SQL standard since '92 it > > seems [2]), set the isolation level the session should use and queue > > up a "SET TRANSACTION ISOLATION LEVEL ..." command to be emitted > > immediately after the decision is made to emit the "BEGIN" that is > > relevant for the dialect. For non-standard implementations like > > sqlite some interpretation would obviously be needed, though. > > This is what ticket 2001 proposes. > session.connection().execution_options(isolation_level='foo') and you're good > to go.
Great! So for the time being (until ticket 2001 makes it, if it does), is below the correct summary of the transaction isolation options available when using SqlAlchemy? PostgreSQL: - per-transaction isolation levels not possible, even with direct execution of "SET TRANSACTION ISOLATION LEVEL" syntax (due to psycopg2 implementation, other APIs may differ) - transaction isolation must be set at a global level using the isolation_level kwarg on create_engine() Sqlite: - global isolation level setup via create_engine() - per-transaction isolation changes may be possible with direct fiddling of autocommit... check pysqlite driver All other DBMS: - no direct SqlAlchemy support of any kind (global/per-connection/per- transaction) for changing transaction isolation levels - Direct manipulation with SQL statements may be possible, but check the docs on the DBAPI driver in use (or snoop SQL emitted by driver) to confirm functionality -- 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.