> like the example illustrates, there is no
> BEGIN being issued for every SELECT statement when using psycopg2 in
> non-autocommit mode, which applies to SQLAlchemy as well.   therefore
> there is no performance bottleneck; this is a django issue only.

I guess we're reading the example differently. I see this BEGIN:

LOG:  statement: BEGIN; SET TRANSACTION ISOLATION LEVEL READ COMMITTED
LOG:  statement: SELECT users.id, users.name FROM users

in the postgres log, but as far as I can tell sqlalchemy is not
sending it; it's being implicitly inserted by psycopg2 because the
isolation level of the connection is read-committed and it sees a
statement outside of a transaction. If the connection were in the
autocommit isolation level, doing the same thing in sqlalchemy would
not result in that BEGIN, only the SELECT would be issued.

> > I noticed a TODO about implementing true autocommit behavior, which is
> > what I need -- a way to tell the dbapi module *not* to start those
> > implicit transactions.
>
> it doesnt.  run the example - no implicit transaction beyond the
> initial connection (which is required, since it must implement
> rollback() and commit()).

Either I'm very confused or I'm having lots of trouble getting my
point across. In my experience, it is absolutely the case that the
dbapi drivers are starting implicit transactions when they aren't in
autocommit mode -- otherwise I don't see how any transactions would
work correctly, since do_begin is a no-op everywhere -- so if the
dbapi modules aren't inserting the BEGIN to start transactions, I
don't see where it could be coming from. What am I missing? If I'm
wrong about what's going on here, how does sqlalchemy start
transactions when it needs to, and where is that BEGIN before the
select in my example coming from?

I have an example that I think illustrates what I'm talking about
pretty well, so I'm going to file a ticket and attach the example and
the postgres query log I see when I run it. Hopefully that will clear
things up one way or another.

JP


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