[DB-SIG] Python 2.0 DB Api - Threading and Transactions not known until connected
Brad Clements
bkc@murkworks.com
Wed, 25 Aug 1999 11:23:00 -0400
I'm writing an ADO DA for Python to the 2.0 DB spec.
I've run into two problems:
1. The threading level isn't known until a connection is established,
since ADO can connect through ODBC, Ole DB and other providers, the
thread safety isn't set until connected.
Is it reasonable to extend the 2.0 spec to say that if
connection.threadsafety exists, use that instead of a module level
variable?
2. Transactions - I don't see a connection.begintransaction() method,
just rollback() and commit(). The spec mentions that auto-commit has
to be disabled, so how does a person turn it on? Why wasn't
begintransaction() included in the spec? Simply calling commit() to turn
on transactions is rather ugly, since the first transaction won't be able to
be rolled-back.
Same problem as in 1, I won't know if transactions are supported until a
connection is established.
Given that thread safety, and transactions are per-connection in this
DA, what is the best way to support this concept within the bounds of
the 2.0 spec?
Since begintransaction() is not specified in the spec, what is the
recommended method for auto-commit vs auto-begin, etc? I'd prefer,
and will need, an explicit begin,commit for use with Zope. Whats the
recommended way to merge this in?
Thanks..
Brad Clements, bkc@murkworks.com (315)268-1000
http://www.murkworks.com (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com ICQ: 14856937