[sqlalchemy] Re: MS SQL wrapper for pymssql DBAPI broken in 0.5.0

2009-01-11 Thread Michael Trier
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
-~--~~~~--~~--~--~---



[sqlalchemy] Re: MS SQL wrapper for pymssql DBAPI broken in 0.5.0

2009-01-11 Thread TJ Ninneman

 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.

Thats awesome, thanks so much for your time and help with this!

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



[sqlalchemy] Re: MS SQL wrapper for pymssql DBAPI broken in 0.5.0

2009-01-10 Thread Michael Trier

 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.


 OK so, this is again where everything works butSAVEPOINT breaks ?


Yes SAVEPOINT would break.  Everything works in the sense that it worked
before. pymssql has tons of failures and one of the reasons why it's
difficult to understand the impact of changes. Overall I think this is the
approach we should take right now. This restores it back to the way it was
before. With the approach in #1 things hang everywhere. I'll look into it,
but for now the best approach in my opinion is to do #2 for now.



 As mentioned previously, pymssql support is no where near the level of
 support as pyodbc. In addition the maintainer has not updated this library
 for several years. Finally, Microsoft warns against it's use going forward,
 When writing new applications, avoid using DB-Library. When modifying
 existing applications, you are strongly encouraged to remove dependencies on
 DB-Library. Instead of DB-Library, you can use Microsoft ActiveX(R) Data
 Objects (ADO), OLE DB, or ODBC to access data in SQL Server.


 whats the story with adodbapi ?   that library is also being actively
 maintained, why is pyodbc better ?


It is now that Vern is behind it and it was included in pywin32. I've been
playing with it the past several days just to see what issues are there.
Overall it tests pretty well but there are certainly errors.  My
understanding is that it's a lot slower than pyodbc.  Other than that I just
don't know. I'd like to get it to full test passing as well. I think it's
certainly possible.

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



[sqlalchemy] Re: MS SQL wrapper for pymssql DBAPI broken in 0.5.0

2009-01-09 Thread Michael Trier
Hi,

On Fri, Jan 9, 2009 at 12:45 PM, t...@twopeasinabucket.com 
t...@twopeasinabucket.com wrote:


 On Jan 7, 10:41 pm, Michael Trier mtr...@gmail.com wrote:
  Hi,
 
  On Wed, Jan 7, 2009 at 10:43 PM, Jaimy Azle jaimy.a...@gmail.com
 wrote:
 
   Hi,
 
   it seems mssql wrapper for pymmsql DBAPI driver in sqlalchemy 0.5.0
   (release) is broken. I haven't check it out with adodbapi, but
   pyodbc confirmed works.
 


Work has been hectic this week.  Anyway, I looked into this and pymssql
doesn't support execute on the connection.  It supports a straight up query
at the module level or it supports execute on the cursor.  So our options
are:

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)

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.

I apologize for this oversight. I had a friend test on pymssql but because
of the number of overall failures is much higher I think he missed the fact
that this wasn't working right.

As mentioned previously, pymssql support is no where near the level of
support as pyodbc. In addition the maintainer has not updated this library
for several years. Finally, Microsoft warns against it's use going forward,
When writing new applications, avoid using DB-Library. When modifying
existing applications, you are strongly encouraged to remove dependencies on
DB-Library. Instead of DB-Library, you can use Microsoft ActiveX(R) Data
Objects (ADO), OLE DB, or ODBC to access data in SQL Server.


Michael Trier
http://blog.michaeltrier.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
-~--~~~~--~~--~--~---



[sqlalchemy] Re: MS SQL wrapper for pymssql DBAPI broken in 0.5.0

2009-01-09 Thread TJ Ninneman
Thanks Michael, I appreciate it.

 As mentioned previously, pymssql support is no where near the level  
 of support as pyodbc. In addition the maintainer has not updated  
 this library for several years. Finally, Microsoft warns against  
 it's use going forward, When writing new applications, avoid using  
 DB-Library. When modifying existing applications, you are strongly  
 encouraged to remove dependencies on DB-Library. Instead of DB- 
 Library, you can use Microsoft ActiveX® Data Objects (ADO), OLE DB,  
 or ODBC to access data in SQL Server.

Yeah, I've always figured I was fairly safe since I run pymssql on top  
of FreeTDS.  But I'm definitely working on porting everything over to  
pyodbc.

Thanks again,

TJ


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



[sqlalchemy] Re: MS SQL wrapper for pymssql DBAPI broken in 0.5.0

2009-01-07 Thread Michael Trier
Hi,

On Wed, Jan 7, 2009 at 10:43 PM, Jaimy Azle jaimy.a...@gmail.com wrote:


 Hi,

 it seems mssql wrapper for pymmsql DBAPI driver in sqlalchemy 0.5.0
 (release) is broken. I haven't check it out with adodbapi, but
 pyodbc confirmed works.


Thanks for the test. I will look at this tomorrow.

Michael

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