On Jan 20, 2011, at 2:04 AM, bool wrote: > > If I dont use autocommit:True option, it seems the driver will be in a > chained transaction mode and results in every single statement > (including selects) being run in a new transaction. This is not > desirable either. > > Is there a way out ?
The DBAPI doesn't do that, since DBAPI calls for a single connection to be open in a transaction immediately, the state of which is only ended by calling rollback or commit on that connection. if you're using SQLalchemy using connectionless execution, i.e. table.insert().execute(), then yes each execute() is in its own transaction, as it should be since no transactional boundary has been declared. This style of usage is not appropriate for a large volume of operations. Usually you create a transaction for a series of operations, which is automatic when using the ORM with a Session object, so that there's a reasonable boundary of transactions. -- 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 sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.