Difference between revisions of "END TRANSACTION"
Yvonnemilne (Talk | contribs) |
Helengeorge (Talk | contribs) |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
==Purpose== | ==Purpose== | ||
End transaction Before Image Journaling | End transaction Before Image Journaling | ||
Line 12: | Line 5: | ||
==Syntax== | ==Syntax== | ||
BEGIN TRANSACTION [<path name>] | BEGIN TRANSACTION [<path name>] | ||
+ | |||
<commands> | <commands> | ||
+ | |||
END TRANSACTION | END TRANSACTION | ||
==See Also== | ==See Also== | ||
− | [[COMPLETED()]], [[ISMARKED()]], [[RESET IN]], [[ROLLBACK]], [[ROLLBACK()]], [[SET ROLLBACK]] | + | [[CLEAR ALL]], [[CLOSE ALL]], [[CLOSE DATABASE]], [[CLOSE INDEX]], [[COMPLETED()]], [[ISMARKED()]], [[MODIFY STRUCTURE]], [[RESET IN]], [[PACK]], [[ROLLBACK]], [[ROLLBACK()]], [[SELECT]], [[SELECT()]], [[SET ROLLBACK]], [[ZAP]] |
Line 23: | Line 18: | ||
The END TRANSACTION command is used to flag the end of a transaction for Before Image Journaling (BIJ). A 'transaction' consists of all file modifications that occur within the commands BEGIN TRANSACTION and END TRANSACTION. | The END TRANSACTION command is used to flag the end of a transaction for Before Image Journaling (BIJ). A 'transaction' consists of all file modifications that occur within the commands BEGIN TRANSACTION and END TRANSACTION. | ||
− | When BEGIN TRANSACTION is issued all currently open files and all files opened between BEGIN and END TRANSACTION will have BIJ invoked automatically. If BIJ is not required on a particular table then the RESET IN command should be issued for the relevant workarea so that journaling will no longer occur in that workarea. The journals are stored in a log file (with a file extension of '.log | + | When BEGIN TRANSACTION is issued all currently open files and all files opened between BEGIN and END TRANSACTION will have BIJ invoked automatically. If BIJ is not required on a particular table then the RESET IN command should be issued for the relevant workarea so that journaling will no longer occur in that workarea. The journals are stored in a log file (with a file extension of '.log') which the Recital/4GL generates automatically. You can optionally specify the disk and directory <path name> where the log file will be stored when the BEGIN TRANSACTION command is issued. |
A "rollback" causes record contents to be restored to their value before modification (i.e. at the time BEGIN TRANSACTION was issued). This is particularly useful if an error occurs during a program that modifies files. | A "rollback" causes record contents to be restored to their value before modification (i.e. at the time BEGIN TRANSACTION was issued). This is particularly useful if an error occurs during a program that modifies files. | ||
Line 32: | Line 27: | ||
Please note that the following commands are not allowed during a transaction: | Please note that the following commands are not allowed during a transaction: | ||
+ | |||
*CLEAR ALL | *CLEAR ALL | ||
*CLOSE ALL | *CLOSE ALL | ||
Line 44: | Line 40: | ||
<code lang="recital"> | <code lang="recital"> | ||
procedure recovery | procedure recovery | ||
− | rollback | + | rollback |
− | if rollback() | + | if rollback() |
− | + | dialog box "Rollback was ok." | |
− | else | + | else |
− | + | dialog box "Rollback not completed." | |
− | endif | + | endif |
return | return | ||
Line 55: | Line 51: | ||
on error do recovery | on error do recovery | ||
begin transaction | begin transaction | ||
− | delete first 15 | + | delete first 15 |
− | insert | + | insert |
− | replace all t1 with (t2*t3)/100 | + | replace all t1 with (t2*t3)/100 |
− | list | + | list |
end transaction | end transaction | ||
if completed() | if completed() | ||
− | + | dialog box "Transaction completed" | |
else | else | ||
− | + | dialog box "Errors occurred during transaction" | |
endif | endif | ||
</code> | </code> | ||
Line 69: | Line 65: | ||
==Products== | ==Products== | ||
− | Recital | + | Recital Server, Recital |
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Commands]] | [[Category:Commands]] | ||
+ | [[Category:Transaction Processing]] | ||
+ | [[Category:Transaction Processing Commands]] |
Latest revision as of 17:12, 10 November 2009
Purpose
End transaction Before Image Journaling
Syntax
BEGIN TRANSACTION [<path name>]
<commands>
END TRANSACTION
See Also
CLEAR ALL, CLOSE ALL, CLOSE DATABASE, CLOSE INDEX, COMPLETED(), ISMARKED(), MODIFY STRUCTURE, RESET IN, PACK, ROLLBACK, ROLLBACK(), SELECT, SELECT(), SET ROLLBACK, ZAP
Description
The END TRANSACTION command is used to flag the end of a transaction for Before Image Journaling (BIJ). A 'transaction' consists of all file modifications that occur within the commands BEGIN TRANSACTION and END TRANSACTION.
When BEGIN TRANSACTION is issued all currently open files and all files opened between BEGIN and END TRANSACTION will have BIJ invoked automatically. If BIJ is not required on a particular table then the RESET IN command should be issued for the relevant workarea so that journaling will no longer occur in that workarea. The journals are stored in a log file (with a file extension of '.log') which the Recital/4GL generates automatically. You can optionally specify the disk and directory <path name> where the log file will be stored when the BEGIN TRANSACTION command is issued.
A "rollback" causes record contents to be restored to their value before modification (i.e. at the time BEGIN TRANSACTION was issued). This is particularly useful if an error occurs during a program that modifies files.
If SET ROLLBACK is ON, the Recital/4GL will automatically execute the ROLLBACK command if an error occurs during the transaction process. Otherwise, error trapping should be handled manually using the ON ERROR command.
The COMPLETED() function can be used after the END TRANSACTION command to determine if any errors occurred during processing of the commands between BEGIN and END TRANSACTION.
Please note that the following commands are not allowed during a transaction:
- CLEAR ALL
- CLOSE ALL
- CLOSE DATABASE
- CLOSE INDEX
- MODIFY STRUCTURE
- PACK
- ZAP
Example
procedure recovery rollback if rollback() dialog box "Rollback was ok." else dialog box "Rollback not completed." endif return use accounts on error do recovery begin transaction delete first 15 insert replace all t1 with (t2*t3)/100 list end transaction if completed() dialog box "Transaction completed" else dialog box "Errors occurred during transaction" endif
Products
Recital Server, Recital