diff --git a/db/db_client/db_client_session.go b/db/db_client/db_client_session.go index 0130f6ba0..13656d83f 100644 --- a/db/db_client/db_client_session.go +++ b/db/db_client/db_client_session.go @@ -68,6 +68,13 @@ func (c *DbClient) AcquireSession(ctx context.Context) (sessionResult *db_common return sessionResult } + // update required session search path if needed + err = c.ensureSessionSearchPath(ctx, session) + if err != nil { + sessionResult.Error = err + return sessionResult + } + if !session.Initialized { session.LifeCycle.Add("queued_for_init") @@ -93,13 +100,6 @@ func (c *DbClient) AcquireSession(ctx context.Context) (sessionResult *db_common session.Initialized = true } - // update required session search path if needed - err = c.ensureSessionSearchPath(ctx, session) - if err != nil { - sessionResult.Error = err - return sessionResult - } - // now write back to the map c.sessionsMutex.Lock() c.sessions[backendPid] = session diff --git a/workspace/session_data_source.go b/workspace/session_data_source.go index 4344b9927..bfe64e48d 100644 --- a/workspace/session_data_source.go +++ b/workspace/session_data_source.go @@ -9,7 +9,6 @@ type SessionDataSource struct { IntrospectionTableSource func() *modconfig.ModResources } -// TODO [report] change this to accept a list of queries instead of and create the cut down preparedStatementSource here // NewSessionDataSource uses the workspace and (optionally) a separate the prepared statemeot source // and returns a SessionDataSource // NOTE: preparedStatementSource is only set if specific queries have ben passed to the query command