Description
This manual connection member function requests 'write' access to the connected store. If there is a 'write-able' buffer available then it is claimed and its address returned. If there are no buffers available (they are all currently opened), then the call will block in accordance with the specified timeout, and then return TRUE if one becomes available within the timeout constraint; or FALSE if it does not. Before reading this topic, we would recommend familiarity with Manual Connections and Transient Stores.
Prototype
Uns OpenWrite( Int key,
Uns timeout );
Parameters
key
This parameter can be used as a means of filtering reads. If a writer specifies a key, then it is associated with the buffer instance. Readers that specify a key and a rule will only be granted access to data that satisfies their specified constraint. See Store Keys and Rules.
timeout
This parameter determines whether the connection will poll or block (see Connection Timeout). It can be set to poll (CLP_POLL), block (CLP_WAIT) or a millisecond timeout.
Return Value
This function returns logical TRUE if the store is successfully opened for write within the timeout period; or FALSE otherwise.
Notes
This member function is overloaded and in the case of 'mapped' connections, the translator will also produce a call that requires no arguments. In that case the arguments will be set to those that were set by the connection's attributes (see Manual Connections).
Store writes issued to data objects accessed by the OpenWrite function will not take effect until a reciprocal Close call is made.
If store buffer mode is anything other than 'CLP_STATIC', then the data object's Construct function call is required prior to data object access (see Store Records).
Writes are only allowed if they are permitted by the connection's access constraints (see Manual Connections).