The 3.2.2 release of our mxODBC
is the latest patch level release of our popular Python ODBC Interface.
In this release, we've included the following the following
enhancements and fixes:
Backported the new .cursortype attribute from the upcoming mxODBC 3.3.
The new attribute allows easily adjusting and inspecting the ODBC cursor type to be used for an mxODBC cursor object.
The reason for this unusual backport and inclusion in a
patch level release is that we found a serious performance issue with MS
SQL Server when using it with mxODBC 3.2 (see below). This needed to be
MS SQL Server performance can now be much enhanced,
and increased to levels beyond that of mxODBC 3.1 and previous
releases, by adjusting the default cursor type to forward-only cursors:
connection = mx.ODBC.Windows.DriverConnect(...) connection.cursortype = mx.ODBC.Windows.SQL.CURSOR_FORWARD_ONLY # Cursors created on this connection will then default to forward # only cursors, instead of the mxODBC 3.2 default for SQL Server # of using static cursors cursor = connection.cursor()
The performance increase compared to mxODBC 3.2.1 is enormous: from 2-3x faster executes/fetches for average queries, up to 300x faster for simple cases.
In mxODBC 3.3, we will switch to using forward-only cursors per default for all database backends.
IBM DB2 can benefit from the same performance enhancements using forward-only cursors.
The effect is a lot smaller, but still noticeable: up to 2x faster executes/fetches with forward-only cursors, compared to mxODBC 3.2.1.
Added documentation to explain the different cursor types, compatibility with different database backends and effects on performance.
Fixed a problem with using mxODBC cursors as context managers: these worked fine in Python 2.6, but had stopped working in Python 2.7 due to changes in the Python internals.
Switched to unixODBC 2.3.1+ API: mxODBC is now compiled
against unixODBC 2.3.1, which finally removes the problems with the ABI
change between 2.2 and 2.3 by switching to a new library version
mxODBC connection objects can now be used as context managers to implicitly commit/rollback transactions.
mxODBC cursor objects can now be used as context managers to implicitly close the cursor when leaving the block (regardless of whether an exception was raised or not)
mxODBC added support for adjustable .paramstyles. Both 'qmark' (default) and 'named'
styles are supported and can be set on connections and cursors. The
'named' style allows easier porting of e.g. Oracle native interface code
mxODBC now supports a writable connection.autocommit attribute to easily turn on/off the connection's auto commit mode.
mxODBC added support for adjustable TIMESTAMP precision via the new connection/cursor.timestampresolution attribute.
mxODBC will round to nearest nanosecond fraction instead of
truncating the value. This will result in fewer conversion errors due to
floating point second values.
mxODBC's connect APIs Connect() and DriverConnect() support
setting connection options prior to connecting to the database via a new
connection_options parameter. This allows enabling e.g. the MARS feature in SQL Server Native Client.
The connection.cursor() constructor now has a new cursor_options parameters which allows configuring the cursor with a set of cursor options.
The .scroll() method supports far more ODBC drivers than before.
Updated the SQL lookup object to include more ODBC SQL parameter codes, including special ones for SQL Server and IBM DB2.
mx.ODBC.Manager will now prefer unixODBC over iODBC.
Previous mxODBC releases used the order iODBC, unixODBC, DataDirect
when looking for a suitable ODBC manager on Unix platforms. unixODBC is
more widely supported nowadays and provides better Unicode support than
The low-cost Standard Edition which provides data connectivity to a single database type, e.g. just MS SQL Server.
The Professional Edition, which gives full access to all mxODBC features.
The Product Development Edition, which allows including mxODBC in applications you develop.
Compared to mxODBC 3.0, we have simplified our license terms to clarify the
situation on multi-core and virtual machines. In most cases, you no
longer need to purchase more than one license per processor or virtual
machine, scaling down the overall license costs significantly compared
to earlier mxODBC releases.
For a complete overview of the available editions, please see the product page.
Users are encouraged to upgrade to this latest mxODBC release to benefit from the new features and updated ODBC driver support.
We have taken special care not to introduce backwards incompatible
changes, making the upgrade experience as smooth as possible.
Customers who have purchased mxODBC 3.2 license can continue to use their licenses with this patch level release.
Customers who have purchased mxODBC 2.x, 3.0 or 3.1 licenses, can benefit from upgrade discounts. We will give out 20% discount coupons going
from mxODBC 2.x to 3.2 and 50% coupons for upgrades from mxODBC 3.x to
3.2. After upgrade, use of the original license
from which you upgraded is no longer permitted.
Please contact the eGenix.com Sales Team with your existing license serials for details for an upgrade discount coupon.