changeObjectVolatility(object: Object; volatility: Integer; conditional: Boolean);
The changeObjectVolatility method of the Object class changes the volatility state of the persistent object specified in the object parameter. (You can change the volatility state only of persistent objects. All transient objects are considered volatile.) For details, see "
Use the volatility parameter to specify the volatility state that you require, represented by one of the following global constants in the
Global Constant | Integer Value | Description |
---|---|---|
Volatility_Frozen | #04 | Object is frozen (that is, it is not updated) |
Volatility_Stable | #08 | Object is stable (that is, it is updated infrequently) |
Volatility_Volatile | #00 | Object is volatile (that is, it is updated often) |
As object volatility state is conditional by default, a frozen object can be updated only by first changing its volatility to Volatility_Stable or Volatility_Volatile.
Use the conditional parameter to specify whether the change is conditional or unconditional. Set the value of this parameter to:
false if the change is unconditional; that is, the change takes place even if an attempt is made to change the volatility of a frozen object that is being used by any other process.
true if the change is conditional; that is, the change takes place only if the object is not in use by another process. In a multiuser system where production mode is set, it is not possible to determine whether an object is in use by another process. In that case, an exception (
See the makeObjectStable or makeObjectVolatile method for an equivalent way to conditionally change the volatility of an object.