Re: API 3.0 limiting paramstyle to ['named', 'qmark'] is okay. ('format' is not desirable)

"M.-A. Lemburg" <[email protected]>
Newsgroups gmane.comp.python.db
Organization eGenix.com Software GmbH; http://www.egenix.com/
Message-ID <[email protected]>
On 17.05.2013 19:52, Vernon D. Cole wrote:
> I am worried about what the module-level attribute does to thread-safety.

We should clearly document the fact that the module level
attribute serves as default value for new connections - it
should really only be set right after importing the module
or before opening any connections.

> If this feature is kept, it should be a class attribute, not a module
> attribute.  We should be doing connections using new style classes.
> 
> conn = dbapi_module.Connection()
> conn.paramstyle = 'oddball'
> conn.connect(your, parameters, here)
>
> or
> 
> dbapi_module.Connection.paramstyle = 'oddball'
> conn = dbapi_module.Connection().connect(parameters)

Hmm, setting attributes on connections or cursors
isn't thread-safe either, so I'm not sure what the
above would solve.

It also introduces problems with the notion of connection objects
always having an open transaction and be a significant change
in the API.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, May 17 2013)
>>> Python Projects, Consulting and Support ...   http://www.egenix.com/
>>> mxODBC.Zope/Plone.Database.Adapter ...       http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________
2013-05-07: Released mxODBC Zope DA 2.1.2 ...     http://egenix.com/go46
2013-05-06: Released mxODBC 3.2.3 ...             http://egenix.com/go45

::::: Try our mxODBC.Connect Python Database Interface for free ! ::::::

   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611
               http://www.egenix.com/company/contact/
_______________________________________________
DB-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/db-sig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.