The SGS stores Managed Object in serialized form in the ObjectStore.
For this reason, changes to Managed Object’s defining class that Serialization considers an “incompatible change” will result in exceptions on attempts to fetch the object. The only current remedy for this situation is to clear the entire object store.
Below are some rules of thumb for avoiding incompatible changes:
-
Always give your Class a hard-coded SerialVersionUID
Without this, many more kinds of changes will be incompatible. -
Do not change a Managed Object from Serializable to Externalizble, or vice versa.
This is an incompatible change -
Do not change a Managed Object froma non-enum classto an enum class, or vice versa
This is also an incompatible change -
Do not change the unqualified name of the class
Yes, this means you cant refactor the class into a new package. The system has no way of knowing if its really the same class or a different one with the same unqualified class name. -
Do not change the type of a primitive field to a non-primitive or different
primitive type, or vice versa
If you need to change the primitive type of a field, declare a new field for it.