On Sat, Jan 10, 2009 at 9:54 PM, Michael Trier <mtr...@gmail.com> wrote:

> 1. Override do_begin so that it creates a cursor and then executes on the
>> cursor:
>>
>>     def do_begin(self, connection):
>>         cursor = connection.cursor()
>>         cursor.execute("SET IMPLICIT_TRANSACTIONS OFF")
>>         cursor.execute("BEGIN TRANSACTION")
>>
>>
>> this would be appropriate since connection doesn't have an execute()
>> method in DBAPI.
>>
>>
> Yeah I didn't even realize that pyodbc supports execute at the connection
> level especially since it is undocumented.  I guess in my mind I thought I
> was dealing with the cursor at that point. So I should change this anyway
> even for pyodbc so we keep in line with the API. I just tested the change
> and it works fine.
>
>
>>
>>
>> 2. Revert to the old behavior by doing:
>>
>>     def do_begin(self, connection):
>>         pass
>>
>> This would only affect pymssql.  Option 2 results in the greatest number
>> of passed tests for straight orm usage, but causes the ever persistent
>> hanging when working with transactional tests. This was the reason for the
>> introduction of those statements (plus visitpoints). I want Mike Bayer to
>> confirm that's the direction he wants to go in, before I proceed.
>>
>>
This has been corrected in http://www.sqlalchemy.org/trac/changeset/5641.  I
actually did both things, since  using the cursor is the right thing to do.

Michael Trier
http://blog.michaeltrier.com/
http://thisweekindjango.com/

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

Reply via email to