Write strategy

From HEWIKI
Jump to: navigation, search

A write strategy defines when changes to a field's value are saved to the GOM's database. The five available write strategies are:

IMMEDIATE
Data changes to an IMMEDIATE field cause the field and its containing node to be marked as dirty. Changes to the containing node's fields are written to the GOM's database immediately after the script execution environment is completed.
LAZY
Data changes to a LAZY field cause the field and its containing node to be marked as dirty. Changes to the containing node's fields are written to the GOM's database at the next opportune moment, at unload or when another field's write strategy causes the node to be saved.
NEXTSAVE
Data changes to a NEXTSAVE field cause the field to be marked as dirty, but not its containing node. Changes to the containing node's fields are written to the GOM's database at unload or when another field causes the node to be saved.
EXPLICIT
Data changes to an EXPLICIT field cause neither the field nor its containing node to be marked as dirty. The field is explicitly dirtied by calling the external DirtyFieldOnNode function. Dirtying the field also dirties its node and queues it for IMMEDIATE writing after the current script execution environment is completed. If a field is never explicitly dirtied its contents WILL NOT be written to the GOM's database; even at unload time.
NEVER
Data changes to a NEVER field cause neither the field nor its containing node to be marked as dirty. Data stored in a NEVER field is never, under any circumstances, persisted to the GOM's database. Furthermore, a NEVER field's value is not loaded from the GOM's database and instead remains set to its default value on creation.


Regardless of the write strategy of a field, all dirty fields of a node are written to the database in a single atomic transaction. This guarantees that a node's fields are always in a consistent state.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox