On Oct 10, 2008, at 10:52 AM, Simon wrote:

>
> Hi all,
>
> I have a non-transactional session accessing a MySQL database with
> InnoDB tables (SA 0.4.7). It's created via
>
>> sessionmaker(bind=self.engine, autoflush=True, transactional=False).
>
> For some queries, I use begin() / commit() for explicit transactions.
> However, after commit()ing, SQLAlchemy wraps all subsequent operations
> on the same session in BEGIN/COMMIT statements (as observable in
> MySQL's SQL log), even though I did not call begin() again! Not even
> close() changes this behavior. Is this intended and if so, how can I
> make it untransactional again?


if you're referring to the BEGIN/COMMIT around a flush(), flush()  
always uses its own transaction if no other transaction is already in  
progress.   It should not be wrapping any SELECT statements inside of  
BEGIN/COMMIT however.

Keep in mind that a DBAPI connection, when used, is *always* in a  
transaction of some kind, so it is impossible to avoid the effects of  
the database's transaction isolation behavior when querying.

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