602SQL Documentation Index  

Protection by Transactions and Transaction Security

Transactions are a tool designed to bind more changes made to the database to a single unit. Database application author defines these transactions and the server makes sure that each transaction is commited as a whole or rolled back. Inconsistencies in the database are prevented in this way, because the changes made during a transaction are not written to the database immediately.

Transaction Security

The critical moment when making transactions is their termination, when the changes are written to the database. The mechanism of transaction security ensures database consistency even in the case that a computer failure may occur when terminating the transaction. Transaction security may be turned on or off by the configuration administrator.

You can turn the transaction security on and off according to current needs. E.g. when importing some large amount of data it's possible to turn off the transaction security.

Transaction security is set on the Control Panel (Operation tab of the Runtime parameters window) or in the API using the server property SecureTransactions.

Flush Changes to Disc

Most of the operating systems have an embedded utility that postpones data changes in files thus making applications faster. However a result of this utility is an undefined state of files on disk. If the transaction security is to work reliably, it's necessary to write all changes to disk when terminating a transaction.

Flushing changes to disc is set on the Control Panel (Operation tab of the Runtime parameters window) or in the API using the server property FlushOnCommit.

Influence on Server Response

While the use of transactions usually lowers the count of writing data to the disc and fastens the operation of the database, the transaction security uses almost twice as much disc operations for each transaction than the normal method (nonsecure transactions). The speed of data read and data search is not influenced by transactions. As an example we show the time measured for 1000 data writes on a very slow computer depending on the transaction security and flush changes to disc state. The actual values may differ on different computer, therefore they're stated as time depending on the type of work.

no security, no flush security, no flush no security, flush security, flush
All actualizations in 1 transaction 1 <2 <2 <2
Each actualization in a new transaction 2 5 41 68