OpenTP1 Version 7 Programming Reference C Language
dc_jnl_ujput - Acquire a user journal
Format
ANSI C, C++
#include <dcjnl.h> int dc_jnl_ujput (char *data, DCULONG dsize, DCLONG ujcode, DCLONG flags) |
K&R C
#include <dcjnl.h> int dc_jnl_ujput (data, dsize, ujcode, flags) char *data; DCULONG dsize; DCLONG ujcode; DCLONG flags; |
Description
The function dc_jnl_ujput() acquires a user journal (UJ), which is UAP historical information, into the system journal file (system_jnl_file). The unit of UJ acquired by calling the function dc_jnl_ujput() once is called an UJ record.
A user journal is not output to the system journal file immediately after the function dc_jnl_ujput() is called. The UJ record is output to the system journal file when the journal buffer becomes full or when the synchronization point at which the transaction processing terminated normally is acquired.
The function dc_jnl_ujput() can be called after the function dc_rpc_open() has been called and before the function dc_rpc_close() is called. Even if an error occurs in the transaction processing that called the function dc_jnl_ujput(), the UJ record that has already been output cannot be invalidated through rollback processing (partial recovery). Even when rollback processing is executed for the transaction processing that called the function dc_jnl_ujput(), the UJ record is output to the system journal file.
Arguments whose values are set in the UAP
data
Specify the UAP historical information to be acquired. Data valid as UAP historical information must be as long as specified for dsize.
dsize
Specify the length of the UAP historical information to be acquired. The specified length must be in the range from 1 to (the value specified for the jnl_max_datasize operand of the system journal file service definition at the acquisition destination - 8).
ujcode
Specify the UJ code as a value from 0 to 255.
flags
Using one of the following values, specify whether to output the UJ record to the system journal file at acquisition of the UJ record.
Return values
Return value | Return value (numeric) | Explanation |
---|---|---|
DC_OK | 0 | Normal termination. |
DCJNLER_PARAM | -1101 | The parameter format is invalid. |
DCJNLER_SHORT | -1102 | The value specified for the length of user journal (dsize value) is 0 or less. |
DCJNLER_LONG | -1103 | The value specified for the length of user journal (dsize value) exceeds the limit. |
DCJNLER_PROTO | -1105 | The dc_rpc_open() function has not been called. Or, the dc_jnl_ujput() function cannot be used because the execution environment of the applicable system is in journal fileless mode. |
Note
A UJ record that is outside the transaction is output to the system journal file when the journal buffer becomes full or when a transaction of another application terminates normally (when the transaction processing is committed). To acquire the UJ record using an application that does not generate transactions, call the function dc_jnl_ujput() in which DCJNL_FLUSH is set for flags at the appropriate timing.
All Rights Reserved. Copyright (C) 2006, 2010, Hitachi, Ltd.