Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #51804 > unrolled thread

RE: Best practice for connections and cursors

Started by"Joseph L. Casale" <jcasale@activenetwerx.com>
First post2013-08-02 13:10 +0000
Last post2013-08-02 13:10 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  RE: Best practice for connections and cursors "Joseph L. Casale" <jcasale@activenetwerx.com> - 2013-08-02 13:10 +0000

#51804 — RE: Best practice for connections and cursors

From"Joseph L. Casale" <jcasale@activenetwerx.com>
Date2013-08-02 13:10 +0000
SubjectRE: Best practice for connections and cursors
Message-ID<mailman.122.1375449150.1251.python-list@python.org>
>Speaking to the OP:  personally, I don't like the approach of putting data access methods at the module level to >begin with.  I'd rather use a class.  Just because it makes sense to have a singleton connection now doesn't mean it >will always make sense as your application grows.
>In fact, the conflict you describe where one cursor is interfering with another cursor suggests that you may >already be at the point of needing multiple connections.  The operation that is creating a temp table and messing >things up should ideally be pulling an unused connection from a pool, so as to avoid potentially contaminating a >connection that may already be in use elsewhere in the code.

Appreciate the opinion, it would clean it up to go this route so I will. It turns out
the long delay was only a result of running the code through PyCharms debugger.

Thanks for the suggestion,
jlc

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web