< Previous | Contents | Next >

3.1.4.3 Commit

Method Syntax: return_value = Commit(parameter)

Description: The method requests forwarding to the persistent data store any data from the SCO that may have been cached by the API Instance since the last call to Initialize(“”) or Commit(“”), whichever occurred most recently. The LMS would then set the error code to 0 (No Error encountered) and return “true”.

If the API Instance does not cache values, Commit(“”) shall return “true” and set the error code to 0 (No Error encountered) and do no other processing.

Cached data shall not be modified because of a call to the commit data method. For example, if the SCO sets the value of a data model element, then calls the commit data method, and then subsequently gets the value of the same data model element, the value returned shall be the value set in the call prior to invoking the commit data method. The


Commit(“”) method can be used as a precautionary mechanism by the SCO. The method can be used to guarantee that data set by the SetValue() is persisted to reduce the likelihood that data is lost because the communication session is interrupted, ends abnormally or otherwise terminates prematurely prior to a call to Terminate(“”).

Parameter: (“”) – empty characterstring. An empty characterstring shall be passed as a parameter.

Return Value: The method can return one of two values. The return value shall be represented as a characterstring. The quotes (“”) are not part of the characterstring returned, they are used purely to delineate the values returned.

true” – The characterstring “true” shall be returned if the data was successfully persisted to a long-term data store.

false” – The characterstring “false” shall be returned if the data was unsuccessfully persisted to a long-term data store. The API Instance shall set the error code to a value specific to the error encountered. The SCO may call GetLastError() to determine the type of error. More detailed information pertaining to the error may be provided by the LMS through the GetDiagnostic() function.