On May 4, 2008, at 9:41 AM, Andrew Stromnov wrote:

>
> Recently I'd switched to SA MySQL connection pool implementation.
> Every time, when app returns connection to pool (through .close()
> method), SA triggers .rollback() on this connection (http://
> www.sqlalchemy.org/trac/browser/sqlalchemy/trunk/lib/sqlalchemy/pool.py#L291) 
> .
> In my case ROLLBACK is rather expensive operation and waste too much
> MySQL time. I'm using MySQL 5.1 and "set autocommit=1" on
> initialization.
>
> How to disable this .rollback() triggering?

its necessary so that any transactional state existing on the  
connection is discarded.   "autocommit=1" is not part of DBAPI so SQLA  
is not built around that model....but even if it is switched on, it  
says nothing about table or row locks which may exist on the  
connection which also would need to be released via ROLLBACK.

do you have any profiling data that illustrate ROLLBACK being  
expensive ?  its generally an extremely cheap operation particularly  
if little or no state has been built up on the connection.



--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to