Download IBM Informix Guide to SQL: Tutorial, Version 5.2
Transcript
Concurrency and Locking
Locking with Other Database Servers
IBM Informix OnLine manages its own locking so that it can provide the different kinds of locks and levels of isolation described in the preceding topics.
Other IBM Informix database servers implement locks using the facilities of
the host operating system, and cannot provide the same conveniences.
Some host operating systems provide locking functions as operating system
services. In these systems, database servers support the SET LOCK MODE
statement.
Some host operating systems do not provide kernel-locking facilities. In these
systems, the database server performs its own locking based on small files
that it creates in the database directory. (These files have the suffix .lok.)
You can tell in which kind of system your database server is running by executing the SET LOCK MODE statement and testing the error code, as in the following fragment of IBM Informix ESQL/C code:
#define LOCK_ONLINE 1
#define LOCK_KERNEL 2
#define LOCK_FILES 3
int which_locks()
{
int locktype;
locktype = LOCK_FILES;
$
set lock mode to wait 30;
if (sqlca.sqlcode == 0) locktype = LOCK_ONLINE;
else
{
$
set lock mode to wait;
if (sqlca.sqlcode == 0) locktype = LOCK_KERNEL;
}
$
set lock mode to not wait; /* restore default condition */
return(locktype);
}
If the database server does not support the SET LOCK MODE statement, your
program is effectively always in NOT WAIT mode; that is, whenever it tries to
lock a row locked by another program, it receives an error code immediately.
Isolation While Reading
IBM Informix database servers other than IBM Informix OnLine do not nor-
mally place locks when fetching rows. There is nothing comparable to the
shared locks used by IBM Informix OnLine to implement the Cursor Stability
isolation level.
7-30
Programs That Modify Data
Related documents
Informix Guide to SQL: Tutorial, Version 6.0
Performance Guide for Informix Dynamic Server, Version 7.3
Informix Guide to SQL: Tutorial
IBM Informix Guide to SQL Reference
Informix Guide to SQL: Tutorial
INSTALLATION MANUAL
Lexmark 3200 User's Manual
•Compact cassette installation
In This Chapter
IBM 000-8697 User's Manual
In This Chapter
Policy Number: 363.5R - St. Croix Central School District