keith cascio wrote: > > Every COMMIT is followed by a ROLLBACK, which appears wasteful. Which > software do I blame for that, SQLAlchemy or the MySQLdb DBAPI > connector?
It's not wasteful at all in the usual case unless one wants to have leftover row/table locks and transactional state sitting idle in their connection pool, preventing other operations from proceeding. In the case of no statements executed since the previous COMMIT, its simple and 100% reliable to issue a simple ROLLBACK instead of attempting to gauge if any further statements *might* have been executed on the connection since the last known COMMIT. This is all within the usual realm of a ROLLBACK costing almost nothing. But since you're on MyISAM and have no transactional state, and somehow a ROLLBACK is incurring unacceptable overhead (curious, do you have any profiling data which illustrates how much time this takes ?), as I mentioned earlier this is configurable, you want to set "reset_on_return" to False in your Pool. you'll need to create the QueuePool manually and pass it to create_engine() using pool=QueuePool(...). > > Thanks, > Keith > > -- > 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.
