mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-26 02:43:43 +03:00
Fixed rollback on error on Zope (ticket #73)
This commit is contained in:
parent
b5de04d2ff
commit
71a4c2bac9
1
NEWS
1
NEWS
|
@ -2,6 +2,7 @@ What's new in psycopg 2.4.4
|
||||||
---------------------------
|
---------------------------
|
||||||
|
|
||||||
- Named DictCursor/RealDictCursor honour itersize (ticket #80).
|
- Named DictCursor/RealDictCursor honour itersize (ticket #80).
|
||||||
|
- Fixed rollback on error on Zope (ticket #73).
|
||||||
|
|
||||||
|
|
||||||
What's new in psycopg 2.4.3
|
What's new in psycopg 2.4.3
|
||||||
|
|
|
@ -47,12 +47,15 @@ class DB(TM, dbi_db.DB):
|
||||||
self.calls = 0
|
self.calls = 0
|
||||||
self.make_mappings()
|
self.make_mappings()
|
||||||
|
|
||||||
def getconn(self, create=True):
|
def getconn(self, init=True):
|
||||||
|
# if init is False we are trying to get hold on an already existing
|
||||||
|
# connection, so we avoid to (re)initialize it risking errors.
|
||||||
conn = pool.getconn(self.dsn)
|
conn = pool.getconn(self.dsn)
|
||||||
conn.set_isolation_level(int(self.tilevel))
|
if init:
|
||||||
conn.set_client_encoding(self.encoding)
|
conn.set_isolation_level(int(self.tilevel))
|
||||||
for tc in self.typecasts:
|
conn.set_client_encoding(self.encoding)
|
||||||
register_type(tc, conn)
|
for tc in self.typecasts:
|
||||||
|
register_type(tc, conn)
|
||||||
return conn
|
return conn
|
||||||
|
|
||||||
def putconn(self, close=False):
|
def putconn(self, close=False):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user