1) Establish a connection and connect to a DB other than the default. e.g. connect -k sybase "NexGen Servers/Sybase ASE/Sybase ASE 15" -d NORTHWIND
2) Now, using Session manager in ADStudio, determine the connection that was created by the above connect command & kill that session
3) Execute select @@version
to ensure that connection was terminated
>[Error] Script lines: 0-0 -------------------------- JZ0C0: Connection is already closed.
4) Now type in session
5) U'll notice that the value for "Database" is blank. If I type in "reconnect", I'm not connected to the NORTHWIND DB, but instead to the default DB specified in server registration
It seems we request a .getCurrentDatabase() which fails because the connection is closed and then clear the database name. On a failure to .getCurrentDatabase() we should check Connection.isClosed() and provide a status of closed to the user. We should also keep the old current database so that when we reconnect we also change back to that database.
(1) Added a 'Status' column to the session table. If the connection is broken, 'Closed' is displayed in this column; otherwise, it should be 'Connected'.
(2) For a broken session, the 'Database' column should display the name of the database that was connected.
(3) To recover a broken session, execute the following commands:
prompt> \session id-of-the-broken-session # skip this step if the broken session is the current session
prompt> \reconnect
(1) Added a 'Status' column to the session table. If the connection is broken, 'Closed' is displayed in this column; otherwise, it should be 'Connected'.
(2) For a broken session, the 'Database' column should display the name of the database that was connected.
(3) To recover a broken session, execute the following commands:
prompt> \session id-of-the-broken-session # skip this step if the broken session is the current session
prompt> \reconnect
Issue #7538 |
Closed |
Fixed |
Resolved |
Completion |
No due date |
Fixed Build trunk/29143 |
No time estimate |
It seems we request a .getCurrentDatabase() which fails because the connection is closed and then clear the database name. On a failure to .getCurrentDatabase() we should check Connection.isClosed() and provide a status of closed to the user. We should also keep the old current database so that when we reconnect we also change back to that database.