Checking the loaded gt4gemstone version inside a GemStone extent
This page shows how to check the version of gt4gemstone loaded inside the GemStone extent and compare it with the client version.
First if the image corresponds to a Glamorous Toolkit release, the image stores the release version.
releaseVersion := GtImage version versionString
If gt4gemstone is already installed in the remote extent, we can connect to it and get the version installed there. The snippet below is a GemStone snippet.This only works if gt4gemstone is installed remotely and the version there is compatible with the current version of Glamorous Toolkit.
GtGsRelease versionString
If gt4gemstone is not installed remotely we can make a plain GCI call to the remote extent, and check if gt4gemstone is installed.
First we setup a new session. The session should already be configured.
defaultSession := GtGemStoneSessionRegistry default defaultSession.
We then check if the gt4gemstone release is present remotely.
classSearchResult := defaultSession evaluateAndWait: 'Globals classesDo: [ :aUserProfile :aSymbolDictionary :aClass | aClass name = #GtGsRelease ifTrue: [ ^ true] ]. false.'
In case a gt4gemstone release is present we can get its version.
self assert: classSearchResult = true.
remoteVersionString := defaultSession evaluateAndWait: 'GtGsRelease versionString'
We can check if this version is the same as the local one.
remoteVersionString = GtImage version versionString
At the end we need to logout from the remote session.
defaultSession close