Programming Guide



sm_tm_push_model_event

Pushes an event onto the transaction event stack

#include <tmusubs.h>
int sm_tm_push_model_event(int event);

event
Any transaction event.

Returns

Description

sm_tm_push_model_event pushes an event onto the transaction event stack. If event is 0, the stack is unchanged and a warning is logged. If the stack is full before the event is pushed, the event that is pushed off the stack is returned.

The transaction manager generates requests in response to commands. It calls this function to push each request onto the stack as an event, to commence event processing for the request. This function can also be used by transaction models or by transaction event functions associated with a table view. The events generated by the transaction manager and those generated by the standard transaction models are defined in tmusubs.h. For a description of these events, refer to Chapter 9, "Transaction Model Events," in this manual and Chapter 35, "Generating Transaction Manager Events," in Application Development Guide.

Example

/* The following example taken from the standard 
transaction model for JDB shows the processing for the
TM_UPDATE request. */
case TM_UPDATE:
/* Do nothing, except for updates */
occ_type = sm_bi_compare();
if (occ_type != BI_UPDATED)
{
break;
}
		if (!reuse_cursor)
{
save_cursor_type = 0;
}
reuse_cursor = 0;
	sm_tm_push_model_event(TM_UPDATE_EXEC);
sm_tm_push_model_event(TM_UPDATE_DECLARE);
sm_tm_push_model_event(TM_GET_SAVE_CURSOR);
break;

See Also

sm_tm_clear_model_events, sm_tm_pop_model_event