diff --git a/pages/database-management/logs.mdx b/pages/database-management/logs.mdx index b5b266075..07ea428a0 100644 --- a/pages/database-management/logs.mdx +++ b/pages/database-management/logs.mdx @@ -129,6 +129,12 @@ RESET SESSION SETTING "log.min_duration_ms"; `SET SESSION SETTING` accepts only the three keys above; any other key raises `Setting "" cannot be set per-session`. +A session value lasts for the client connection. A failed query or a rollback +keeps it, including the Bolt `RESET` a driver sends after a failure. Switching +to another user on the same connection (the driver re-authenticates, sending +`LOGOFF` and `LOGON`) clears it, and the global value applies again. The new +user can set their own. + ## Access logs If you installed Memgraph with Linux, logs can be found in the diff --git a/pages/database-management/monitoring.mdx b/pages/database-management/monitoring.mdx index 1ea5dfe9c..f513722c9 100644 --- a/pages/database-management/monitoring.mdx +++ b/pages/database-management/monitoring.mdx @@ -772,6 +772,10 @@ The command returns the unique UUID of the session being traced: Use this UUID to find the session's events in the log. From this point on, every query executed in the session emits tagged trace events until tracing is turned off. +Tracing lasts for the client connection. A failed query or a rollback keeps it on, including the Bolt `RESET` a driver +sends after a failure. Switching to another user on the same connection (the driver re-authenticates, sending `LOGOFF` +and `LOGON`) turns it off. The new user can turn it on again and gets the same session UUID. + #### Reading the trace Each trace event is a line in the main log prefixed with the session tag, the user (when authenticated) and the current diff --git a/pages/database-management/multi-tenancy.mdx b/pages/database-management/multi-tenancy.mdx index 3099a932f..a422ef44d 100644 --- a/pages/database-management/multi-tenancy.mdx +++ b/pages/database-management/multi-tenancy.mdx @@ -585,6 +585,8 @@ with driver.session(database="db2") as session: session.run("USE DATABASE db1") # Error: database switching disabled ``` +The database selected with `USE DATABASE` stays selected for the client connection. A failed query or a rollback keeps it, including the Bolt `RESET` a driver sends after a failure. Switching to another user on the same connection (the driver re-authenticates, sending `LOGOFF` and `LOGON`) clears it. Queries then run on the database the new session requests, or on the new user's [main database](#users-main-database). + ### Audit Logs Audit logs now encompass the active database name, positioned immediately after diff --git a/pages/fundamentals/transactions.mdx b/pages/fundamentals/transactions.mdx index 98c93a0dd..1231a3725 100644 --- a/pages/fundamentals/transactions.mdx +++ b/pages/fundamentals/transactions.mdx @@ -532,6 +532,10 @@ SET TRANSACTION ISOLATION LEVEL - SESSION - apply the new isolation level only for the current session - NEXT - apply the new isolation level only for the next transaction in the current session +A SESSION setting lasts for the client connection. A failed query or a rollback keeps it, including the Bolt `RESET` a driver sends after a failure. +Switching to another user on the same connection (the driver re-authenticates, sending `LOGOFF` and `LOGON`) clears both a SESSION setting and a pending NEXT one. +The new user's transactions then run at the database's current isolation level. + `` defines the isolation level: - SNAPSHOT ISOLATION - READ COMMITTED