![]() | Programming Guide | ![]() |
Tests for common database errors during transaction manager processing
#include <tmusubs.h>int sm_tm_dbi_checker(int event);
eventTM_TEST_ERRORto check for database errors,TM_TEST_ONE_ROWto check that one row was affected by the processing, orTM_TEST_SOME_ROWSto check that one or more rows was affected by the processing.
- ·
TM_FAILURE:
sm_tm_dbi_checkertests 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
eventisTM_TEST_ONE_ROW,sm_tm_dbi_checkerreturns the error statusTM_FAILUREif @dmrowcount is not 1.Similarly, if
eventisTM_TEST_SOME_ROWS,sm_tm_dbi_checkerreturns the error statusTM_FAILUREif@dmrowcountis0.
/* 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;
![]()
![]()
![]()
![]()