Bug 49577

GemStone/S 64 Bit

3.4.5, 3.4.4, 3.4.3, 3.4.2, 3.4.1, 3.4, 3.3.9, 3.3.8, 3.3.7, 3.3.5, 3.3.4, 3.3.3, 3.3.2, 3.3.1, 3.3, earlier versions

3.5

Upgrade from 2.x issue for SessionMethods installed for users other than DataCurator

Session Methods are expected to be in the UserGlobals of DataCurator; if they are installed for users other than DataCurator, they are not handled correctly during upgrade.

Session Methods are an undocumented feature allowing session-specific methods to be installed.  It is particularly used in the GLASS/Seaside/GsDevKit environment.

Workaround

Executing the following code allows the upgrade to complete.

You must edit to specify the user name for the user in whose UserGlobals the session methods are installed, and to provide the password for SystemUser (for security, this should never be swordfish).  Execute using topaz prior to upgrade.

set user SystemUser pass swordfish
login

run
 "Disable session methods to prevent executing methods that need recompile"
  AllUsers
    do: [ :userProfile | 
      | assoc | 
      userProfile userId = 'DataCurator'	"userId of user in which GLASS is installed"
        ifTrue: [
          (assoc := userProfile symbolList resolveSymbol: #'UserGlobals') isNil
            ifFalse: [
              | key ug packagePolicy |
              ug := assoc value.
              key := GsPackagePolicy globalName.
              (packagePolicy := ug at: key otherwise: nil) isNil
                ifTrue: [
                  nil error: 'Expected a packagePolicy for ', userProfile userId ]
                ifFalse: [
                  GsFile gciLogServer: 'PRESERVED session methods for ', userProfile userId ] ] ]
        ifFalse: [
          (assoc := userProfile symbolList resolveSymbol: #'UserGlobals') isNil
            ifFalse: [ 
              | key ug packagePolicy homeSymbolDict |
              ug := assoc value.
              key := GsPackagePolicy globalName.
              (packagePolicy := ug at: key otherwise: nil) isNil
                ifFalse: [ 
                  ug at: key put: nil.
                  (homeSymbolDict := packagePolicy instVarAt: (packagePolicy class allInstVarNames indexOf: #homeSymbolDict)) isNil
                    ifTrue: [ GsFile gciLogServer: 'No homeSymbolDict for ', userProfile userId ]
                    ifFalse: [
                      GsFile gciLogServer: 'homeSymbolDict named ', homeSymbolDict name printString, ' for ', userProfile userId.
                      (homeSymbolDict at: key otherwise: nil) isNil
                        ifTrue: [
                          GsFile gciLogServer: 'No package found in session methods homeSymbolDict for ', userProfile userId ]
                        ifFalse: [
                          homeSymbolDict at: key put: nil.
                          GsFile gciLogServer: 'Package in session methods homeSymbolDict cleared for ', userProfile userId ]].
                       System commitTransaction ifFalse: [ nil error: 'COMMIT failed' ].
                       GsFile gciLogServer: 'DISABLED session methods for ' , userProfile userId ] ] ] ].
^ 'done'
%
logout

Last updated: 6/24/21