Individual Object Volatility
For individual JADE objects, the JoobObject Volatility property indicates the object’s volatility. It can have one of the following values.
-
JoobObjectVolatility.Volatile
-
JoobObjectVolatility.Stable
-
JoobObjectVolatility.Frozen
An object’s volatility can be changed using the JoobObject SetVolatility method, which has the following signature.
void SetVolatility(JoobObjectVolatility volatility, bool conditional);
The conditional parameter specifies whether changing the volatility of a frozen object should be conditional or unconditional. If conditional, a JoobCannotThawClassInUseException is thrown if the object’s class is in use. The conditional parameter is ignored when changing the volatility of volatile or stable objects.
Unconditionally change the volatility of a frozen object only when it can be assured that no other JADE sessions are using the object.
If production mode is set, volatility can be conditionally changed only in single user mode. If attempted in multiuser mode, a JoobFeatureNotAvailableException is thrown.
The following example demonstrates defining a collection to be stable.
Company company = null; //... company.AllStaff.SetVolatility(JoobObjectVolatility.Stable, false);
The following example demonstrates checking if an object is stable.
if (company.AllStaff.Volatility == JoobObjectVolatility.Stable) Console.WriteLine("{0} is stable", company.AllStaff.ToString());
The following example demonstrates thawing a frozen object conditionally.
company.Codes.SetVolatility(JoobObjectVolatility.Volatile, true);
The Schema Inspector displays class and object volatility by default, which enables you to check whether objects and collections are set to stable or frozen without having to write code to determine the volatility state of an object or collection.