I cant find any official docs for psycopg2 on this, except the  
impression from some various mailing list posts that postgres is in  
"serializable" mode by default, and also if you want to change the  
isolation mode you use connection.set_transaction_isolation(<some  
number>).  also i dont know what the mapping of numbers to isolation  
modes is (might be on the postgres site).

anyway, SA gives you access to the connection like this:

conn = engine.connect()
conn.connection.set_transaction_isolation(1)
trans = conn.begin()

.etc.

you could also set it on all connections globally using a connection  
function:

def connect():
        c = psycopg2.connect(<args>)
        c.set_transaction_isolation(1)
        return c

e = create_engine('postgres://', creator=connect)


On Oct 15, 2006, at 8:22 AM, Sol wrote:

>
> Hello,
> how would I use serializable transactions with SA and Postgres? Is  
> there
> something around that i missed?
>
> -- 
> Cheers, Sol.
>
> >


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to