When to set the WriteNow parameter in the Obj-Sav and Obj-Delete methods
The WriteNow option to the Obj-Save and Obj-Delete methods is useful in a few very specific scenarios only. System Architects should take care to use this option only in places where it will not interfere with standard flow processing. Standard flow processing already saves and commits work information, and an interceding Obj-Save with the WriteNow option can cause information to become inconsistent.
The WriteNow option instructs the PRPC engine to immediately save and commit the page specified, and includes several ramifications. The Obj-Save WriteNow transaction:
- Can be overwritten by a previous deferred Save (for example, in the case of flow processing)
- Prevents rollback when there are errors with the statement
- Does NOT represent the end of a transaction in and of itself
- Does NOT release a lock or terminate other deferred saves
Use the Obj-Save method with the WriteNow option primarily outside of flow processing.
Here are some examples of when to use Obj-Save with the WriteNow option selected:
- In a rule called by a SOAP service, you might save one object with the WriteNow option selected because it is unnecessary to perform a deferred transaction (Obj-Save or Obj-Delete) for one object that is immediately followed by a Commit transaction.
- Write to a log or history class to report progress during a larger transaction.
- Write a new object out to disk during a larger transaction so that a subsequent database browse picks it up.