mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Use the same cursor object of a connection object only from the same
server. Current implementation keeps the cursor object in the 'g' (current request context) object identified by the connection-id. But - it fails to identify a different connection object request, when we have same database name in different database server, it does not able to identify it as separate request, Hence - now we will use server-id qualified identifier for the same object. Thanks Neel Patel for pointing out the issue.
This commit is contained in:
parent
81e59be1bd
commit
7f790a7f49
@ -342,7 +342,7 @@ WHERE
|
||||
return True, None
|
||||
|
||||
def __cursor(self):
|
||||
cur = getattr(g, self.conn_id, None)
|
||||
cur = getattr(g, str(self.manager.sid) + '#' + self.conn_id, None)
|
||||
|
||||
if self.connected() and cur and not cur.closed:
|
||||
return True, cur
|
||||
@ -408,7 +408,7 @@ Attempt to reconnect it failed with the error:
|
||||
else:
|
||||
return False, errmsg
|
||||
|
||||
setattr(g, self.conn_id, cur)
|
||||
setattr(g, str(self.manager.sid) + '#' + self.conn_id, cur)
|
||||
|
||||
return True, cur
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user