@@ -44,6 +44,7 @@ module ProjectM36.Client
4444 NotificationCallback,
4545 emptyNotificationCallback,
4646 EvaluatedNotification(..),
47+ atomTypesAsRelation,
4748 AtomType(..)) where
4849import ProjectM36.Base hiding (inclusionDependencies) --defined in this module as well
4950import qualified ProjectM36.Base as B
@@ -53,11 +54,11 @@ import Control.Monad.State
5354import qualified ProjectM36.RelationalExpression as RE
5455import ProjectM36.TransactionGraph
5556import ProjectM36.TransactionGraph.Persist
56−import ProjectM36.Attribute
57+import ProjectM36.Attribute hiding (atomTypes)
5758import ProjectM36.Persist (DiskSync(..))
5859import ProjectM36.Notifications
5960import ProjectM36.Server.RemoteCallTypes
60−import ProjectM36.AtomType (atomTypesAsRelation)
61+import ProjectM36.AtomType (typesAsRelation)
6162import Network.Transport.TCP (createTransport, defaultTCPParameters, encodeEndPointAddress)
6263import Control.Distributed.Process.Node (newLocalNode, initRemoteTable, runProcess, LocalNode, forkProcess)
6364import Control.Distributed.Process.Extras.Internal.Types (whereisRemote)
@@ -506,10 +507,14 @@ headName sessionId (InProcessConnection _ _ sessions graphTvar) = do
506507headName sessionId conn@(RemoteProcessConnection _ _) = remoteCall conn (ExecuteHeadName sessionId)
507508
508509atomTypesAsRelation :: SessionId -> Connection -> IO (Either RelationalError Relation)
509−atomTypesAsRelation sessionId (InProcessConnection _ _ sessions) = do
510+atomTypesAsRelation sessionId (InProcessConnection _ _ sessions _) = do
510511 atomically $ do
511512 eSession <- sessionForSessionId sessionId sessions
512513 case eSession of
513514 Left err -> pure (Left err)
514− Right (Session discon) -> do
515+ Right (Session (DisconnectedTransaction _ context)) -> do
516+ case typesAsRelation (atomTypes context) of
517+ Left err -> pure (Left err)
518+ Right rel -> pure (Right rel)
519+atomTypesAsRelation sessionId conn@(RemoteProcessConnection _ _) = remoteCall conn (RetrieveAtomTypesAsRelation sessionId)
515520