home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Press 1997 July
/
Sezamfile97_1.iso
/
msdos
/
database
/
pdx_ti2.arj
/
TI1063.ASC
next >
Wrap
Text File
|
1993-02-23
|
9KB
|
331 lines
PRODUCT : Paradox for DOS, Paradox for Windows NUMBER : 1063
VERSION : All
OS : DOS,WIN
DATE : February 23, 1993 PAGE : 1/5
TITLE : Paradox Table and Directory Locks
Intended Audience:
Paradox network users
Prerequisites:
A basic understanding of network and DOS rights, and multi-table
forms.
Purpose:
An explanation of Paradox table locks, and how they interact with
each other.
Suggested Reading:
Technical Information Sheet #1246, Paradox Table Formats and
Network Locking Protocols
Technical Information Sheet #1109, Record Locks on a Network in
Paradox 4.0
Paradox 3.5 or earlier: Chapter 2 of the User's Guide
Paradox 4.0: Chapter 21 of the User's Guide
Paradox for Windows: Chapter 3 of the User's Guide
When Paradox is running on a network, it allows you to share
tables with other users. However, not all operations can occur
simultaneously, so Paradox will lock tables to make sure that it
can complete operations with no interruptions from other users.
Normally, Paradox will implicitly lock tables as you do your
work. Sometimes, though, you may want to lock tables explicitly
to ensure that you have access to them.
Paradox for Windows uses the same locking mechanism of Paradox
4.0, so all the information here applies to both. There is a
section at the end which explains the equivalencies between the
two versions.
Let's start with the basic table locks that have existed since
Paradox 2.0:
PFL Prevent Full Lock -- guarantees that you will be able to
access (view/read) a table.
PWL Prevent Write Lock -- guarantees that you will be able to
change the data in a table
PRODUCT : Paradox for DOS, Paradox for Windows NUMBER : 1063
VERSION : All
OS : DOS,WIN
DATE : February 23, 1993 PAGE : 2/5
TITLE : Paradox Table and Directory Locks
WL Write Lock -- prevents other users from modifying the data
in a table.
FL Full Lock -- prevents other users from accessing a table.
In Paradox for DOS, locks can be set either with Tools | Net |
Lock or PreventLock, or with the PAL LOCK command. The LOCK
command can be used for placing several locks simultaneously,
guaranteeing access to all tables before starting an operation.
If you are the only person accessing a table, you can put any
combination of locks on it. However, if someone else has already
locked a table, you may be prevented from locking it. The
following table shows which locks you can place if another user
has already locked the table:
Other User
YOU FL WL PWL PFL
Full Lock
Write Lock X X
Prevent Write Lock X X
Prevent Full Lock X X X
If you want to be the only user allowed to modify a table (while
still allowing other users to view the table), use a combination
of WL and PWL.
Query locks
In all versions of Paradox, queries involving INSERT, DELETE or
CHANGETO will always place a Full Lock at DO_IT! The situation
for regular queries (this also applies to reports) is a bit more
complex:
In Paradox 3.5 and earlier, a query places a Prevent Full Lock on
the table(s), which means that other users can still modify the
table in CoEdit or DataEntry modes. Each time a change gets
posted, the query must restart, unless it has already read the
entire table.
PRODUCT : Paradox for DOS, Paradox for Windows NUMBER : 1063
VERSION : All
OS : DOS,WIN
DATE : February 23, 1993 PAGE : 3/5
TITLE : Paradox Table and Directory Locks
This process of restarting is called a "clean query", because it
produces a consistent view of the data. While this is usually
good, the query may take a long time to finish if the table is
being constantly updated.
In Paradox 4.0 (and Paradox for Windows) you can choose between a
Restart query and a Continue query which does not restart.
Continue queries are also known as "dirty queries". A Continue
query functions exactly the same as a query in Paradox 3.5
(including the PFL), except that it does not restart, so your
data may not be completely consistent.
Restart queries function a bit differently in Paradox 4.0. When
the query starts, it attempts to place a Query Write Lock on the
table(s). If an explicit Prevent Write Lock has been placed by
another user (causing the QWL to fail), the Restart query
functions exactly the same as a Paradox 3.5 query.
If the QWL succeeds, no other user can modify the table until
Paradox has finished reading it.
The QWL is different from a regular Write Lock because it ignores
the implicit PWL placed by a record lock. I.e., if other users
have records locked, the QWL will still succeed. The QWL will
allow other users to finish coediting the current record, but
they will not be allowed to make any further modifications until
the QWL is released.
The only way to guarantee that you can modify records is to place
an explicit PWL or to make sure that all other users do Continue
queries.
PRODUCT : Paradox for DOS, Paradox for Windows NUMBER : 1063
VERSION : All
OS : DOS,WIN
DATE : February 23, 1993 PAGE : 4/5
TITLE : Paradox Table and Directory Locks
Form Locks
In Paradox 3.0 and Paradox 3.5, the ability to create multi-table
forms was added. To support this feature, a new kind of Write
Lock was created, the Form Lock (Form Write Lock, or FWL). The
FWL gets activated any time a user coedits a multi-table form
with a 1-1 or 1-M detail table.
Once the FWL is activated, all other users see a WL unless they
use the same form as User A.
Note that the FWL will not be placed if the master table is in
User A's private directory, or if none of the detail tables have
a 1-1 or 1-M relationship.
Form Locks no longer exist in Paradox 4.0 or Paradox for Windows.
They have been replaced by the Group Lock, a form of record lock.
For more information, see Tech Info Sheet #1109.
Directory Locks
Paradox 4.0 introduced a completely new kind of lock, the
DirLock. The DirLock is a "unique" lock because other users can
remove the DirLock. Also, it is the only lock that will stay in
place even if you exit from Paradox.
The effect of the DirLock is most similar to a write protected
table (Tools | More | Protect | Write-protect). If you try to
access a table in a DirLocked directory, you will get the same
error messages (and error codes for PAL programmers) that a write
protected table produces.
After you place a DirLock, you will not be allowed to make the
DirLock directory your working directory or private directory.
PRODUCT : Paradox for DOS, Paradox for Windows NUMBER : 1063
VERSION : All
OS : DOS,WIN
DATE : February 23, 1993 PAGE : 5/5
TITLE : Paradox Table and Directory Locks
The primary reason for the DirLock is to create a permanent .LCK
file. Normally, Paradox cannot access a read-only directory,
because it can't create the .LCK file needed to handle data-
sharing. To make a directory read-only, you must first place a
DirLock in the directory, and then exit Paradox. (The DirLock is
permanent until removed, so there will still be a .LCK file in
that directory.) Now you can use your network software to mark
the directory as read-only.
Note: Paradox 4.0 does allow you to mark individual files as
read-only. You can use either the DOS ATTRIB command, or your
network software (e.g. Novell's FILER).
Paradox for Windows
The following list shows the locks available in Paradox for
Windows, and the equivalent lock(s) from Paradox 4.0:
Windows DOS
Open Lock PFL
Read Lock WL
Write Lock WL *and* PWL
Exclusive Lock FL
Note that Paradox for Windows does not have a direct equivalent
for the Paradox 4.0 Prevent Write Lock. The only way to generate
a PWL in Paradox for Windows is to open up a TCursor and lock a
record, which creates an implicit PWL.
In Paradox for Windows, you set locks interactively with File |
Multi-user | Set Locks. From OPAL, Lock() can be used as a
procedure, or as a Table or TCursor method.
DISCLAIMER: You have the right to use this technical information
subject to the terms of the No-Nonsense License Statement that
you received with the Borland product to which this information
pertains.