The ServerLockManager
synchronizes locking among various Oracle Commerce Platform servers, so only one at a time can modify the same item. At least one Oracle Commerce Platform 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:
<ATG11dir>/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 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 |
---|---|
| This server’s port |
| The other |
| The port of the |
| The interval in milliseconds that this server waits before polling the server specified in |
| The time in milliseconds that this server waits after detecting that the primary |
For example, given ServerLockManagers
tartini.acme-widgets.com
and corelli.acme-widgets.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 Oracle Commerce Platform instance as a page server that handles user sessions. By running the ServerLockManager
in a separate Oracle Commerce Platform instance, the overhead of managing locks has no impact on user sessions, and the page server can restart independently of the ServerLockManager
.