mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-22 00:46:33 +03:00
Fixed connections re-init across ZSQL methods
Fixes issue #142, probably #123 and #125 too.
This commit is contained in:
parent
0653861bc4
commit
a64fd31fd1
3
NEWS
3
NEWS
|
@ -12,7 +12,8 @@ What's new in psycopg 2.4.6
|
||||||
(ticket #113).
|
(ticket #113).
|
||||||
- 'register_hstore()', 'register_composite()', 'tpc_recover()' work with
|
- 'register_hstore()', 'register_composite()', 'tpc_recover()' work with
|
||||||
RealDictConnection and Cursor (ticket #114).
|
RealDictConnection and Cursor (ticket #114).
|
||||||
- Fixed broken pool for Zope (tickets #123, #125).
|
- Fixed broken pool for Zope and connections re-init across ZSQL methods
|
||||||
|
in the same request (tickets #123, #125, #142).
|
||||||
- connect() raises an exception instead of swallowing keyword arguments
|
- connect() raises an exception instead of swallowing keyword arguments
|
||||||
when a connection string is specified as well (ticket #131).
|
when a connection string is specified as well (ticket #131).
|
||||||
- Discard any result produced by 'executemany()' (ticket #133).
|
- Discard any result produced by 'executemany()' (ticket #133).
|
||||||
|
|
|
@ -71,7 +71,7 @@ class DB(TM, dbi_db.DB):
|
||||||
pool.putconn(self.dsn, conn, close)
|
pool.putconn(self.dsn, conn, close)
|
||||||
|
|
||||||
def getcursor(self):
|
def getcursor(self):
|
||||||
conn = self.getconn()
|
conn = self.getconn(False)
|
||||||
return conn.cursor()
|
return conn.cursor()
|
||||||
|
|
||||||
def _finish(self, *ignored):
|
def _finish(self, *ignored):
|
||||||
|
@ -81,7 +81,7 @@ class DB(TM, dbi_db.DB):
|
||||||
self.putconn()
|
self.putconn()
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def _abort(self, *ignored):
|
def _abort(self, *ignored):
|
||||||
try:
|
try:
|
||||||
conn = self.getconn(False)
|
conn = self.getconn(False)
|
||||||
|
@ -95,7 +95,7 @@ class DB(TM, dbi_db.DB):
|
||||||
# then get and immediately release a connection
|
# then get and immediately release a connection
|
||||||
self.getconn()
|
self.getconn()
|
||||||
self.putconn()
|
self.putconn()
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
# FIXME: if this connection is closed we flush all the pool associated
|
# FIXME: if this connection is closed we flush all the pool associated
|
||||||
# with the current DSN; does this makes sense?
|
# with the current DSN; does this makes sense?
|
||||||
|
|
Loading…
Reference in New Issue
Block a user