Show TOC

 Synchronization of Buffers

Use

You want to synchronize an implementation of a buffer using the LUW administration of the correspondence tool, in order to ensure that the content of the buffer is written to the database before the completion of an LUW.

Prerequisites

When implementing a buffer for outputting correspondence requests, you need to ensure that only documents that are output completely are stored in the buffer. It is also essential that parts that are already stored in the buffer can be invalidated in case of errors.

Procedure

By calling the GET_LUW_HANDLER_INTERFACE static method of the CL_FKK_CORR_PERSISTENCE class, you can make a reference available on the IF_FKK_CORR_LUW_HANDLER interface of LUW administration. This interface retrieves the necessary events, DB Change in Preparation (event EV_SAVE_REQUESTED) and DB Change Is Completed (event EV_FINISHED). You can synchronize your buffer by implementing and registering event handlers in buffer management for these events.

When correspondence requests are output, the Last call indicator (parameter FLG_LAST_CALL of event EV_SAVE_REQUESTED) is set by the correspondence tool in the last LUW of the output. If several work processes are used to process the output in parallel, then the indicator is set in each work process in the last LUW.

If you want to synchronize buffers in other contexts, you have to set the Last call indicator by calling the SET_LAST_CALL method of the interface (named above) within the last LUW.

Example

For outputting correspondence requests, you use an application form that has the Data Dispatch form type. You want the data to be sent to another system. To improve performance, you want packages of optimum size to be generated for the dispatch method. You only want a "remaining package" to be created for output before the completion of an LUW. You can achieve this using synchronization with LUW control. There is an indicator in the last call that gives you the choice of ending a connection or closing a file.