SET DATABASE ACCESS

Sets an exclusive or shared access to a database.

Syntax

SET DATABASE ACCESS EXCLUSIVE|SHARED

Comments

This command enables a specific user (usually the database administrator) to grant himself/herself exclusive access to a ZIM database. Under normal conditions, database access is shared among users; however, in some situations, the administrator may want exclusive access to the database (i.e. urgent program recompilation or database maintenance).  To obtain exclusive access the database administrator can issue the command with the option EXCLUSIVE.

At this point the ZIM Server stops accepting new incoming transactions, waits for the existing transactions to end and then grants exclusive Database access to the specific user.  Any subsequent requests from other users are kept in a suspended state. As soon as all transactions stop, all files are closed. Therefore, it is possible to issue operating system commands to deal with physical database files.

When the exclusive access is no longer required, the command can be issued with the option SHARED.

From this point, Zim Server activity is resumed and all suspended state users can continue with their normal processing.

At the end of the session that set the exclusive access and if the access was not reverted to shared, then Zim Server automatically sets the shared attribute to that database.

 

SET CHECKPOINT

Enables or disables the checkpoint activity over changed buffers.

Syntax

SET CHECKPOINT ON|OFF

Comments

The CHECKPOINT option is set ON by default.

When CHECKPOINT is ON, all data changed in transactions successfully committed by users is sent to a checkpoint file which then is later committed to the database. In this way, the server can guarantee modifications and rollback transactions if some are aborted. It also allows the backup of databases in real time.

When CHECKPOINT is OFF, all data changed in transactions is sent immediately to the database. There is no guarantee of the data being written in case a transaction is aborted. Only one user can perform this kind of operation and the database remains in exclusive access for this user. This options simulates a single-user behaviour and is mainly designed to load big amounts of data as when a fresh database is being created or imported from another version of Zim.

SET TIMEOUT

Syntax

SET TIMEOUT time

The SET TIMEOUT sets a timeout amount for the FILEPATH options PORT and CONNECTOR in the command SET INPUT.

Comments

By default, the time is set to zero.

For historical reasons, the value of time must be specified in tenths of a second, that is, for 5.5 seconds, it should say 55.

When opening a document for input with SET INPUT with above options, any subsequent statements referring the specified document will terminate if not satisfied within the time interval specified by time.

Example

set timeout 55
set input stdin filepath "connector://localhost:2333"
list 10 stdin

If the LIST statement is not satisfied within 5.5 seconds, the LIST is terminated.

en_CAEnglish