The persistent macro functions support transaction processing in Net.Data by helping you define which macro blocks are persistent within a single transaction. Use these functions to define the start and end of a transaction, which HTML blocks are persistent throughout the transaction, the scope of the variables within the transaction, and whether to commit or rollback changes within the transaction.
AIX | HP-UX | Linux | OS/2 | OS/390 | OS/400 | SCO | SUN | Win NT |
|
|
|
|
| X |
|
|
|
Purpose
Defines the transaction handle used to invoke a persistent macro.
Format
@DTW_ACCEPT(handle, timeout)
@DTW_ACCEPT(handle)
Parameters
Table 209. DTW_ACCEPT Parameters
Data Type | Parameter | Use | Description |
---|---|---|---|
string | handle | IN | A variable or literal string specifying a transaction handle to be used in URLs for subsequent macro invocations in this persistent transaction. |
integer | timeout | IN | A variable or literal string specifying an amount of time in seconds for the job servicing this port to wait for a response. This value overrides any timeout value specified on the DTW_STATIC() function. |
Return Codes
Table 210. DTW_ACCEPT Return Codes
Return Code | Explanation |
---|---|
-1001 | The server could not process a Net.Data request to allocate memory. |
1001 | An input parameter contained a NULL value. |
1003 | The number of parameters passed on a function call either exceeded the maximum number allowed, or was less than the minimum number required by the function. |
1005 | A parameter passed on a function call, required to be a string variable, was of a different variable type. |
1007 | A parameter contains a value which is not valid. |
8200 | Macro persistence is not enabled. |
8201 | A persistent built-in function was called out of sequence. |
Usage Notes
The transaction handle must be called at the start of each HTML block in the macro until the last logical block, which contains a call to DTW_TERMINATE(). If either a call to DTW_ACCEPT() or DTW_TERMINATE() is not found before any text is output to the browser, a Net.Data error occurs.
Examples
Example 1:
%DEFINE handle = "" @DTW_RTVHANLDE(handle) %HTML(REPORT){ @DTW_ACCEPT(handle) ... %}
AIX | HP-UX | Linux | OS/2 | OS/390 | OS/400 | SCO | SUN | Win NT |
|
|
|
|
| X |
|
|
|
Purpose
Makes permanent any pending changes made to resources under commitment control since the last commitment boundary and establishes a new commitment boundary.
Format
@DTW_COMMIT()
Parameters
None.
Return Codes
Table 211. DTW_COMMIT Return Codes
Return Code | Explanation |
---|---|
1003 | The number of parameters passed on a function call either exceeded the maximum number allowed, or was less than the minimum number required by the function. |
Examples
Example 1: Specifies a commit
@DTW_COMMIT() %HTML(report){ %}
AIX | HP-UX | Linux | OS/2 | OS/390 | OS/400 | SCO | SUN | Win NT |
|
|
|
|
| X |
|
|
|
Purpose
Reestablishes the last commitment boundary as the current commitment boundary. All changes to resources under commitment control for the process that Net.Data is running under made since the last commitment boundary are backed out.
Format
@DTW_ROLLBACK()
Parameters
None.
Return Codes
Table 212. DTW_ROLLBACK Return Codes
Return Code | Explanation |
---|---|
1003 | The number of parameters passed on a function call either exceeded the maximum number allowed, or was less than the minimum number required by the function. |
Examples
Example 1: Specifies a rollback
@DTW_ROLLBACK() %HTML(report){ %}
AIX | HP-UX | Linux | OS/2 | OS/390 | OS/400 | SCO | SUN | Win NT |
|
|
|
|
| X |
|
|
|
Purpose
Generates and returns a transaction handle that is unique to this macro across separate invocations and is calculated based on a combination of thread information, timestamp, and current user.
Format
@DTW_RTVHANDLE(handle)
Parameters
Table 213. DTW_RTVHANDLE Parameters
Data Type | Parameter | Use | Description |
---|---|---|---|
string | handle | OUT | A variable that contains a unique transaction handle for the current persistent macro. |
Return Codes
Table 214. DTW_RTVHANDLE Return Codes
Return Code | Explanation |
---|---|
-1001 | The server could not process a Net.Data request to allocate memory. |
1003 | The number of parameters passed on a function call either exceeded the maximum number allowed, or was less than the minimum number required by the function. |
1005 | A parameter passed on a function call, required to be a string variable, was of a different variable type. |
1006 | A literal string was passed on a function call for a parameter which was required to be an output parameter. |
Usage Notes
The transaction handle can be used to ensure that URLs specified as part of a persistent transaction are unique to the HTTP server and can be securely identified as valid requests.
Examples
Example 1: Defines the handle variable used to retrieve the transaction handle
%DEFINE handle = "" @DTW_RTVHANLDE(handle)
AIX | HP-UX | Linux | OS/2 | OS/390 | OS/400 | SCO | SUN | Win NT |
|
|
|
|
| X |
|
|
|
Purpose
Indicates that the entire macro is persistent.
Format
@DTW_STATIC(timeout)
@DTW_STATIC()
Parameters
Table 215. DTW_STATIC Parameters
Data Type | Parameter | Use | Description |
---|---|---|---|
integer | timeout | IN | A variable or literal string that specifies an amount of time, in seconds, that the process handling this transaction should wait for a response. |
Return Codes
Table 216. DTW_STATIC Return Codes
Return Code | Explanation |
---|---|
-1001 | The server could not process a Net.Data request to allocate memory. |
1001 | An input parameter contained a NULL value. |
1003 | The number of parameters passed on a function call either exceeded the maximum number allowed, or was less than the minimum number required by the function. |
1005 | A parameter passed on a function call, required to be a string variable, was of a different variable type. |
1007 | A parameter contains a value which is not valid. |
8202 | Persistence could not be enabled. |
Usage Notes
Examples
Example 1: A call to DTW_STATIC() specifying a timeout value of 60 seconds.
@DTW_STATIC("60")
AIX | HP-UX | Linux | OS/2 | OS/390 | OS/400 | SCO | SUN | Win NT |
|
|
|
|
| X |
|
|
|
Purpose
Ends a persistent transaction. All changes to resources under commitment control since the last commitment boundary are made permanent.
Format
@DTW_TERMINATE()
Parameters
None
Return Codes
Table 217. DTW_TERMINATE Return Codes
Return Code | Explanation |
---|---|
-1001 | The server could not process a Net.Data request to allocate memory. |
1003 | The number of parameters passed on a function call either exceeded the maximum number allowed, or was less than the minimum number required by the function. |
8200 | Macro persistence is not enabled. |
8201 | A persistent built-in function was called out of sequence. |
Usage Notes
Examples
Example 1: Terminates the persistent transaction
%HTML(QUIT){ @DTW_TERMINATE() ... %}