HiOn Fri, Jan 5, 2018 at 7:50 AM, Harshal Dhumal <harshal.dhumal@enterprisedb.com> wrote:Further details:1. If session is expired and user performs any action from sqleditor that makes ajax callthen in ajax error call back user can check and handle login related error using code snippet.if (pgAdmin.Browser.UserManagement.is_pga_login_required(xhr)) { return pgAdmin.Browser.UserManagement.pga_login();}Where is xhr is standard xhr or jqxhr object.2. Similarly for connection lost (only maintenance db connection as we can recover or reconnect otherconnections if maintenance db connection is alive). It will attempt to create/reconnect connection withoutasking password (to handle passwordless connection, or saveed password or password from pgpass file)If connection to database still fails then it'll prompt for password.Code snippet:SqlEditorController.handle_connection_lost(); once connection lost is detected one can call handle_connection_lost() to reconnect.3. We maintain some additional data in session to maintain affinity betweeneach sqleditor/datagrid instance to backend database connection. However if session expires and userre-loggins then we need to first restore affinity between sqleditor to backend database before we can startusing query tool.Code snippet:if(is_new_transaction_required(xhr)) { SqlEditorController.init_transaction();}(note: I haven't looked at the code yet)How does this handle re-establishment of the connection mid-transaction, or, if the user has modified any session variables?
Further details:1. If session is expired and user performs any action from sqleditor that makes ajax callthen in ajax error call back user can check and handle login related error using code snippet.if (pgAdmin.Browser.UserManagement.is_pga_login_required(xhr)) { return pgAdmin.Browser.UserManagement.pga_login();}Where is xhr is standard xhr or jqxhr object.2. Similarly for connection lost (only maintenance db connection as we can recover or reconnect otherconnections if maintenance db connection is alive). It will attempt to create/reconnect connection withoutasking password (to handle passwordless connection, or saveed password or password from pgpass file)If connection to database still fails then it'll prompt for password.Code snippet:SqlEditorController.handle_connection_lost(); once connection lost is detected one can call handle_connection_lost() to reconnect.3. We maintain some additional data in session to maintain affinity betweeneach sqleditor/datagrid instance to backend database connection. However if session expires and userre-loggins then we need to first restore affinity between sqleditor to backend database before we can startusing query tool.Code snippet:if(is_new_transaction_required(xhr)) { SqlEditorController.init_transaction();}
if (pgAdmin.Browser.UserManagement.is_pga_login_required(xhr)) { return pgAdmin.Browser.UserManagement.pga_login();}
if(is_new_transaction_required(xhr)) { SqlEditorController.init_transaction();}
-- Dave PageBlog: http://pgsnake.blogspot.comTwitter: @pgsnakeEnterpriseDB UK: http://www.enterprisedb.comThe Enterprise PostgreSQL Company
pgadmin-hackers by date:
Соглашаюсь с условиями обработки персональных данных