On Feb 11, 2011, at 4:48 AM, Romy wrote:

> Ah, very good to know, thank you.
> 
> Does this also mean that, assuming a transactional engine like Inno,
> while using autocommit=True, issuing a session.begin() does nothing
> since a transaction's already in progress ?

autocommit=True means every SELECT statement as well as every flush() uses its 
own transaction, that begins as the method is called, and is immediately 
closed, within the scope of the method call on your end.   begin() *only* works 
when autocommit=True, and only affects the way SQLAlchemy pulls connections 
from the connection pool.    DBAPI has no "begin", the connection itself is 
always in a transaction as soon as statements are emitted, unless commit() or 
rollback() is called.


> 
> On Feb 10, 12:27 pm, Michael Bayer <[email protected]> wrote:
>> DBAPI requires that connections are in a transaction at all times in any 
>> case unless you are using special flags specific to the database library 
>> that disable it.   So generally its better to conform to that model by 
>> having one long transaction rather than lots of little ones, since they are 
>> always there regardless.
>> 
>> note by "long transaction" we don't mean a transaction that's held open for 
>> two hours.  we mean one that is long enough for a successive series of 
>> related activities.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To post to this group, send email to [email protected].
> 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.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected].
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