![]() | Programming Guide | ![]() |
Closes the current database transaction, allowing you to discard or save your changes
int sm_tm_command ("CLOSE [tableViewName[tableViewScope] ]");
tableViewName- The name of a table view in the current transaction. This parameter is case sensitive.
If
tableViewNameis specified, the command is applied according to thetableViewScopeparameter. Since the entire table view tree might not be included, this is known as a partial command, andsm_tm_commandsetsTM_FULLto 0.If
table View Nameis not specified, the command is applied for each table/server view, starting with the root table view. This is known as a full command, andsm_tm_commandsetsTM_FULLto 1.table View Scope- One of the following parameters, which must be preceded by a table view name.
TV_AND_BELOWwhich applies the command to the specified table view and all table views below it on the tree. If no parameter is specified, the transaction manager acts as thoughTV_AND_BELOWwas supplied.BELOW_TVwhich applies the command to the table views below the specified table view.TV_ONLYwhich applies the command to the specified table view only.SV_ONLYwhich applies the command only to the table views of the specified server view.
If changes are made in table views on which
CLOSEoperates after aSELECT,NEW,COPY, orCOPY_FOR_UPDATEcommand,CLOSEdisplays a dialog box which allows users to discard any changes entered. If the user chooses OK, changes are discarded; choosing Cancel, returns the user to the current screen so changes can be saved. In Web applications, this command is the same as theFORCE_CLOSEcommand.
CLOSEsets the transaction mode to initial unless a table view is specified. In the default styles file (style.sty), the style assigned to initial mode clears any protections on the widgets.Push buttons and menu selections for the
CLOSEcommand can choose to set the class property toclose_button. By default,close_buttonis inactive in initial mode but active in all other modes.For some database engines, such as SYBASE CT-Lib, the
CLOSEcommand does not release the database locks when aSELECTcommand is not followed by aSAVEcommand. In this case, follow theCLOSEwith theRELEASEcommand which gives up the locks on the database.
The
CLOSEcommand is useful afterSELECT,NEW,COPY, orCOPY_FOR_UPDATEin order to discard your changes.
The
TM_CLOSEandTM_QUERYrequests have four possible return values:TM_NO_ACTION,TM_DISCARD_ACTION,TM_SAVE_ACTION, andTM_EXIT_ACTION. The distributed transaction models use two of these return values:
TM_DISCARD_ACTIONdiscards the changes to the data.
TM_EXIT_ACTIONreturns the user to the screen in order to choose theSAVEcommand or make additional changes.
If
TM_SAVE_ACTIONis used as a return value, all the requests associated with theSAVEcommand (exceptTM_PRE_SAVEandTM_POST_SAVE) are completed, but this processing is not used in the distributed transaction models.
![]()
![]()
![]()
![]()