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
tableViewName
is specified, the command is applied according to thetableViewScope
parameter. Since the entire table view tree might not be included, this is known as a partial command, andsm_tm_command
setsTM_FULL
to 0.If
table View Name
is 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_command
setsTM_FULL
to 1.table View Scope
- One of the following parameters, which must be preceded by a table view name.
TV_AND_BELOW
which 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_BELOW
was supplied.BELOW_TV
which applies the command to the table views below the specified table view.TV_ONLY
which applies the command to the specified table view only.SV_ONLY
which applies the command only to the table views of the specified server view.
If changes are made in table views on which
CLOSE
operates after aSELECT
,NEW
,COPY
, orCOPY_FOR_UPDATE
command,CLOSE
displays 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_CLOSE
command.
CLOSE
sets 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
CLOSE
command can choose to set the class property toclose_button
. By default,close_button
is inactive in initial mode but active in all other modes.For some database engines, such as SYBASE CT-Lib, the
CLOSE
command does not release the database locks when aSELECT
command is not followed by aSAVE
command. In this case, follow theCLOSE
with theRELEASE
command which gives up the locks on the database.
The
CLOSE
command is useful afterSELECT
,NEW
,COPY
, orCOPY_FOR_UPDATE
in order to discard your changes.
The
TM_CLOSE
andTM_QUERY
requests 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_ACTION
discards the changes to the data.
TM_EXIT_ACTION
returns the user to the screen in order to choose theSAVE
command or make additional changes.
If
TM_SAVE_ACTION
is used as a return value, all the requests associated with theSAVE
command (exceptTM_PRE_SAVE
andTM_POST_SAVE
) are completed, but this processing is not used in the distributed transaction models.