The server lock manager synchronizes locking among various ATG servers, so only one at a time can modify the same item. At least one ATG server must be configured to start the /atg/dynamo/service/ServerLockManager component on application startup.

To do this, add the ServerLockManager to the initialServices property of /atg/dynamo/service/Initial in the ServerLockManager server’s configuration layer. For example:

<ATG9dir>/home/localconfig/atg/dynamo/service/Initial.properties

This properties file sets the initialServices property as follows:

#/home/localconfig/atg/dynamo/service/Initial.properties:

initialServices+=ServerLockManager
ServerLockManager failover

You can configure two ServerLockManagers, where one acts as the primary lock server and the other serves as backup. The primary ServerLockManager is determined by a string comparison of two lock server property settings, lockServerAddress and lockServerPort, where the server with the lower string value is designated as the primary ServerLockManager.

On detecting that failure of the primary ServerLockManager, the backup ServerLockManager takes over and clients redirect lock requests to it. If both ServerLockManagers fail, caching is disabled and all data is accessed directly from the database. Caching resumes when the one of the ServerLockManagers restarts.

ServerLockManager properties

A ServerLockManager component is configured with the following properties:

Property

Description

port

This server’s port

otherLockServerAddress

The other ServerLockManager’s address

otherLockServerPort

The port of the ServerLockManager specified in otherLockServerAddress

otherServerPollInterval

The interval in milliseconds that this server waits before polling the server specified in otherLockServerAddress

waitTimeBeforeSwitchingFromBackup

The time in milliseconds that this server waits after detecting that the primary ServerLockManager has failed, before taking over as the primary ServerLockManager

For example, given ServerLockManagers tartini.acme-widgets.com and corelli.acmewidgets.com running on port 9010, their respective configurations might look like this:

# tartini:9010
$class=atg.service.lockmanager.ServerLockManager
port=9010
otherLockServerAddress=corelli.acme-widgets.com
otherLockServerPort=9010
otherServerPollInterval=2000
waitTimeBeforeSwitchingFromBackup=10000
# corelli:9010
$class=atg.service.lockmanager.ServerLockManager
port=9010
otherLockServerAddress=tartini.acme-widgets.com
otherLockServerPort=9010
otherServerPollInterval=2000
waitTimeBeforeSwitchingFromBackup=10000
Running ServerLockManager and page servers

A ServerLockManager should not run in the same ATG instance as a page server that handles user sessions. By running the ServerLockManager in a separate ATG instance, the overhead of managing locks has no impact on user sessions; and the page server can restart independently of the ServerLockManager.

 
loading table of contents...