Collecting documents from a Document Broker repository > Script functions for updating metadata

Script functions for updating metadata
Document Broker Plus post processing scripts support the following script functions to update document metadata in the Document Broker repository:
Using only these script functions for updating metadata in the Document Broker repository is inefficient as they only can store one metadata item at time. This results in heavy database traffic and poor performance for Projects that require metadata update. To solve this problem, you can use the following cache script functions in addition to the Save<xx>Metadata functions:
These cache script functions will cache the metadata updated by Save<xx>Metadata, and then store the cached metadata in the Document Broker repository.
You must add PPBeginDocMDUpdate before you execute the Save<xx>Metadata functions in order to make StreamServer cache the metadata instead of storing the metadata directly in the Document Broker repository. Then you add PPCommitDocMDUpdate after the Save<xx>Metadata functions are executed in order to send the metadata from the cache to the Document Broker repository.
If you at some point want to stop storing cached metadata in the Document Broker repository, you can use the PPRollbackDocMDUpdate function. This function can be called based on some conditions, and when executed it clears all metadata that is still in the cache.
Script execution levels
You can call the cache script functions at any post-processor script level. For example, if PPBeginDocMDUpdate is called at Job Begin and PPCommitDocMDUpdate is called at Job End, all metadata belonging to all documents are saved when the post-processor job finishes. The consideration here could be memory used by cache for really big jobs.
Note:
The scope cannot be nested. A second call to PPBeginDocMDUpdate without first calling PPCommitDocMDUpdate or PPRollbackDocMDUpdate will return an error.
Improving performance in upgraded Projects
If you upgrade a Document Broker for FastObjects Project to Document Broker Plus, and if the Projects contains Save<xx>Metadata functions, you can improve performance by just inserting PPBeginDocMDUpdate before and PPCommitDocMDUpdate after the Save<xx>Metadata functions are executed.
OpenText StreamServe 5.6 Updated: 2013-03-01