Programming Guide |
Tests for common database errors during transaction manager processing
#include <tmusubs.h>int sm_tm_dbi_checker(int event);
event
TM_TEST_ERROR
to check for database errors,TM_TEST_ONE_ROW
to check that one row was affected by the processing, orTM_TEST_SOME_ROWS
to check that one or more rows was affected by the processing.
- ·
TM_FAILURE
:
sm_tm_dbi_checker
tests the Panther database variables @dmretcode and @dmengerrcode for any errors in database processing. If it finds an error, it logs it and sets error messages.If no database errors are encountered but
event
isTM_TEST_ONE_ROW
,sm_tm_dbi_checker
returns the error statusTM_FAILURE
if @dmrowcount is not 1.Similarly, if
event
isTM_TEST_SOME_ROWS
,sm_tm_dbi_checker
returns the error statusTM_FAILURE
if@dmrowcount
is0
.
/* The following example taken from the standard
transaction model for JDB shows the processing for
these events. */case TM_TEST_ERROR:
case TM_TEST_ONE_ROW:
case TM_TEST_SOME_ROWS:
retcode = sm_tm_dbi_checker(event);
break;