Skip to content

Commit

Permalink
Merge pull request #328 from YuMingLiao/master
Browse files Browse the repository at this point in the history
load GraphRefRelVars instead of real expressions
  • Loading branch information
agentm authored Dec 1, 2021
2 parents 531d1c6 + 3317721 commit f1fe611
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/ProjectM36/Client.hs
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ createSessionAtCommit_ commitId newSessionId (InProcessConnection conf) = do
case RE.transactionForId commitId graph of
Left err -> pure (Left err)
Right transaction -> do
let freshDiscon = DisconnectedTransaction commitId (Trans.schemas transaction) False
let freshDiscon = DisconnectedTransaction commitId (Discon.loadGraphRefRelVarsOnly commitId (Trans.schemas transaction)) False
keyDuplication <- StmMap.lookup newSessionId sessions
case keyDuplication of
Just _ -> pure $ Left (SessionIdInUseError newSessionId)
Expand Down
9 changes: 9 additions & 0 deletions src/lib/ProjectM36/DisconnectedTransaction.hs
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
module ProjectM36.DisconnectedTransaction where
import ProjectM36.Base
import Data.Map

concreteDatabaseContext :: DisconnectedTransaction -> DatabaseContext
concreteDatabaseContext (DisconnectedTransaction _ (Schemas context _) _) = context

schemas :: DisconnectedTransaction -> Schemas
schemas (DisconnectedTransaction _ s _) = s

loadGraphRefRelVarsOnly :: TransactionId -> Schemas -> Schemas
loadGraphRefRelVarsOnly commitId (Schemas ctx@(DatabaseContext _ rv _ _ _ _) subschemas) =
let f k _ = RelationVariable k (TransactionMarker commitId)
ctx' = ctx { relationVariables = mapWithKey f rv}
in Schemas ctx' subschemas



parentId :: DisconnectedTransaction -> TransactionId
parentId (DisconnectedTransaction pid _ _) = pid

Expand Down

0 comments on commit f1fe611

Please sign in to comment.