miliamerican.blogg.se

Transaction processing system functions
Transaction processing system functions




These functions can be used to get an index value without using the LOCK command. It is not rolled back as part of transaction rollback. Using $INCREMENT and $SEQUENCE in TransactionsĪ call to the $INCREMENT or $SEQUENCE function is not considered part of a transaction. A value set in $TEST during a transaction does not roll back. For further details, refer to the “ Lock Management” chapter of this book. Outside of the transaction, however, the lock remains locked. Within the transaction, the lock appears to be unlocked, permitting a subsequent lock of the same value. If the lock is in a delock state, Caché defers the unlock until the transaction is committed or rolled back. The lock is unlocked, but cannot be acquired by another process until the end of the current transaction. The lock can be immediately acquired by another process. Within a transaction, when you unlock a lock held by the process, one of two things may occur: There are three important considerations when using locks in transactions: Other processes wishing to change the value of the global request a lock which waits until the first process releases the lock. The LOCK command is used to both lock and unlock a specified lock. You issue a lock corresponding to the global variable, change the value of the global, then unlock the lock. Whenever you access a global which might be accessed by more than one process, you need to protect the integrity of the database by using the LOCK command on that global. The Caché MultiValue Basic (MVBasic) transaction commands are also compatible with ObjectScript and SQL transaction commands. If you need compatibility with the SQL standard, use START TRANSACTION.

transaction processing system functions

Therefore, if you need (or may need) nested transactions, it is preferable to start the transaction with TSTART. However, START TRANSACTION does not support nested transactions. ObjectScript TSTART and SQL START TRANSACTION both start a transaction if no transaction is current. These ObjectScript and SQL commands are fully compatible and interchangeable, with the following exception: Signals an unsuccessful end of transaction all the database updates performed since the beginning of transaction should be rolled back or undone. Can be used for partial rollback to a savepoint. These SQL and ObjectScript commands are summarized in the following table. In addition, Caché implements some of the transaction commands that are part of the M Type A standard. It also supports the Caché SQL extensions SET TRANSACTION, START TRANSACTION, SAVEPOINT, and %INTRANS. Transaction CommandsĬaché supports the ANSI SQL operations COMMIT WORK and ROLLBACK WORK (in Caché SQL the keyword WORK is optional). In Caché, you define transactions within applications using eitherīoth techniques work, regardless of whether the database modifications that constitute the transactions are performed with SQL INSERT, UPDATE, and DELETE statements or ObjectScript SET and KILL commands. Managing Transactions Within Applications You can use the Management Portal, System Operation, System Logs, Console Log option to view cconsole.log. Caché also handles transaction rollback automatically in the event of a system failure and at various junctures, such as recovery and during HALT or ResJob.Ĭaché records rollbacks in the cconsole.log file if the LogRollback configuration option is set.

transaction processing system functions

If a program error or system malfunction leads to an incomplete transaction, then the part of the transaction that was completed is rolled back.Īpplication developers should handle transaction rollback within their applications. Under normal circumstances, the transaction executes in its entirety. One command marks the beginning of the transaction after a sequence of possibly many commands, another command marks the end of the transaction. In such cases, you use transaction processing commands to define the sequence of operations that forms a complete transaction.

transaction processing system functions

Within your application, a single SQL INSERT, UPDATE, or DELETE statement, or a single global SET or KILL, may not in itself constitute a complete transaction. By specifying that both updates form a single transaction, you ensure that either both operations are performed or neither is performed, which means that one cannot be executed without the other. Transaction processing helps maintain the logical integrity of your database.įor example, when transferring money from one account to another, a bank may need to subtract an amount from a field in one table and add the same amount to a field in another table.

transaction processing system functions

System-Wide Issues with Transaction ProcessingĪ transaction is a logical unit of work. $INCREMENT and $SEQUENCE in a Transaction This chapter covers the following topics: System-Wide Issues with Transaction Processing.Managing Transactions Within Applications.






Transaction processing system functions