Programming Guide |
Pushes an event onto the transaction event stack
#include <tmusubs.h>int sm_tm_push_model_event(int event);
event
- Any transaction event.
- 0 Success:
event
pushed on stack and stack was not full.
- · The event value pushed off the stack because the stack was full.
sm_tm_push_model_event
pushes an event onto the transaction event stack. Ifevent
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.
/* 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;
sm_tm_clear_model_events, sm_tm_pop_model_event