Programming Guide



sm_tm_failure_message

Specifies an error message to report for a transaction manager error

#include <tmusubs.h>
int sm_tm_failure_message(int type, char *caller_id, char *text);

type
The event calling this function. This event must be TM_NOTE_FAILURE or TM_NOTE_UNSUPPORTED.

caller_id
Identifier for the calling program. If this is not supplied, the generated caller_id has embedded in it the previous event name or number and the previous transaction model or transaction event function name.

text
The text for the error message. If this is not supplied, a generic error message is generated.

Returns

Description

When the transaction manager generates either the TM_NOTE_FAILURE or the TM_NOTE_UNSUPPORTED event, the standard transaction models call sm_tm_failure_message to generate an error message for the previous event.

sm_tm_failure_message checks the value of TM_STATUS and sets it to -1 if the value is 0.

Example

/* The following example taken from the standard
transaction model for JDB shows the processing for
these events. */
	case TM_NOTE_FAILURE:
case TM_NOTE_UNSUPPORTED:
retcode = sm_tm_failure_message(event, "", "");
break;