ALTER SESSION RESET
Resets the session state of the current connection to its initial values
ALTER SESSION RESET
Resetting the session can be useful for reusing the connection by a client application (for example, by a client-side connection pool).When this statement is executed, all user context variables are cleared, contents of global temporary tables are cleared, and all session-level settings are reset to their initial values.
It is possible to execute ALTER SESSION RESET without a transaction.
Execution of ALTER SESSION RESET performs the following steps:
-
Error isc_ses_reset_err (
335545206) is raised if any transaction is active in the current session other than the current transaction (the one executingALTER SESSION RESET) and two-phase transactions in the prepared state. -
System variable
RESETTINGis set to TRUE. -
ON DISCONNECTdatabase triggers are fired, if present and if database triggers are not disabled for the current connection. -
The current transaction (the one executing
ALTER SESSION RESET), if present, is rolled back.A warning is reported if this transaction modified data before resetting the session. -
Session configuration is reset to their initial values.This includes, but is not limited to:
-
DECFLOATparameters (TRAPandROUND) are reset to the initial values defined using the DPB at connect time, or otherwise the system default. -
Session and statement timeouts are reset to zero.
-
The current role is restored to the initial value defined using DPB at connect time, and — if the role changed — the security classes cache is cleared.
-
The session time zone is reset to the initial value defined using the DPB at connect time, or otherwise the system default.
-
The bind configuration is reset to the initial value defined using the DPB at connect time, or otherwise the database or system default.
-
In general, configuration values should revert to the values configured using the DPB at connect time, or otherwise the database or system default.
-
-
Context variables defined for the
USER_SESSIONnamespace are removed (USER_TRANSACTIONwas cleared earlier by the transaction roll back). -
Global temporary tables defined as
ON COMMIT PRESERVE ROWSare truncated (their contents is cleared). -
ON CONNECTdatabase triggers are fired, if present and if database triggers are not disabled for the current connection. -
A new transaction is implicitly started with the same parameters as the transaction that was rolled back (if there was a transaction)
-
System variable
RESETTINGis set to FALSE.
|
Note
|
|