Broker 10.5 | webMethods Broker Documentation | webMethods Broker Administration Java API Programmer’s Guide | Managing Brokers and Broker Servers | Managing Brokers | Using Change Locks
 
Using Change Locks
If you have multiple client applications that want to manage a Broker, race conditions may result if more than one client attempts to update the Broker's configuration.
You can use the BrokerAdminClient.acquireChangeLock method to obtain a lock for the Broker to which a BrokerClient is connected. This method will return a BrokerChangeLock object with the variables shown in the following table.
Data Member
Description
BrokerBoolean acquired;
Set to 1 (true) if the lock was acquired by this BrokerClient, otherwise set to 0 (false).
String client_id;
If acquired is 0 (false), this member will contain the ID of the client currently holding a lock on the Broker. Otherwise, this member will be set to NULL. For information on client IDs, see Broker Client Administration.
int session_id;
If acquired is 0 (false), this member will contain the session ID of the client currently holding a lock on the Broker. Otherwise, this member will be set to zero.
BrokerDate lock_time
If acquired is 0 (false), this member will contain the date and time the lock was acquired. Otherwise, this member will be set to NULL.
Your client application should use the BrokerAdminClient.releaseChangeLock method to release a Broker change lock, after it has finished updating the Broker.