mssql+zxjdbc patch for sqlalchemy 0.6
Here's a patch for mssql+zxjdbc support for 0.6. It requires jtds-1.2.2.jar from http://jtds.sf.net
Comments (8)
-
-
repo owner what's this for ?
+ + if self.server_version_info <= MS_2008_VERSION: + self.use_scope_identity = False
that turns off use_scope_identity on all versions unconditionally. the feature works fine on 2005 and 2008, not sure about earlier versions.
-
Account Deleted The scope identity was blowing up on me when using SQL Server Express 2005. I don't have a license for the 'full' 2005 server version so maybe this is a bug in MSSQL2005 express?
-
- changed watchers to crankycoder@gmail.com, empty
I finally tested this with SQL Server Express 2005 last night and noticed the same thing with jTDS. What was weird is the select scope_identity seemed to succeed, but the result set returned None instead of the generated key
Victor, I know you were also testing against pyodbc on CPython, did it have the same problem?
-
repo owner I test on express 2005 as well, but not with jython.
-
So scope_identity only seems to work with jtds when it's appended onto the end of the insert statement (so both are in the same prepared statement). Kind of stupid for an otherwise nice jdbc driver
Attached is a workaround, with that the test suite ends up with (SKIP=9, errors=9, failures=9) which is pretty good except for it having the mark of the devil when you look at it upside down
-
- changed status to resolved
applied in f385260987da45ce140edba986b1ac0c2a6a9e35. This needs the latest Jython trunk w/ a zxJDBC fix for the dialect's use of scope_identity
Test suite is down to:
FAILED (SKIP=9, errors=9, failures=5)
I can see fixes for some of these but I'm not sure about a lot of them. Is mssql+pyodbc fully passing right now?
-
repo owner - removed milestone
Removing milestone: 0.6.xx (automated comment)
- Log in to comment
Thanks Victor! Couple points:
o Do we need the scope_identity change in base? (I’m not that familiar with the mssql dialects but I know that’s been True for a long time now, and Mike’s on vacation)
o What do you think of having the url use the normal spots for the user/password args i.e. create_engine(‘mssql+zxjdbc://user:password@hostname’). And also converting any extra query args automatically to jdbc options (since they both come in and go out as string values). I did this for the default zxjdbc connect args recently, but jtds would needs its own version for its ; delimiter. i.e.
create_engine(‘mssql+zxjdbc://user:pass@hostname/dbdomain=foo&bufferMaxMemory=512’) -> jdbc:jtds://hostname/db;user=user;password=pass;domain=foo;bufferMaxMemory=512