more robust database sharing
ChemFinder has fairly intricate scheme for handling database access, dealing with such
issues as multi-user file sharing and read-only access. In ChemFinder 5, we have
reengineered the scheme for compatibility with new database mechanisms, and in the process
have increased reliability and added features.
Updated 16 Jun 98 for Alpha2
Read-Only Database Access
When you open a ChemFinder database, you can interact with the data in one of two ways:
- Normal Access: you can read (browse, search, view tables, export) and write (edit
data, add records, modify tables).
- Read-Only Access: you can read but not write. The database cannot be modified in
[ Note: A third possibility, Exclusive Access, is available
through CAL, but is not fully supported at present.]
Under normal circumstances, the user may choose to open a database in either mode.
However, if the database is write-protected, the program will override the user's choice
and insist on read-only mode.
A database will be opened for read-only access:
- If any of the component files (extensions .cfw, .mdb, .ldb, .mst, .msi) have read-only
- If the files reside on read-only media, such as CD-ROM.
- If the user checks the Read-Only box in the File Open dialog when opening either
the form or the database.
- If the database is being opened by opening a form file, and when the form was saved the
database was in read-only mode. When you save a form file, it saves the current mode of
When a database is open for read-only access:
- The word READ appears on the status line.
- You may not modify data in text boxes.
- You may edit molecule structures, but will be prevented from moving away from a record
after modifying the structure.
If a database and/or form has been opened read-only, you can
change it to normal access, or vice-versa. You can choose File Database
or right-click on the form and choose Database, then re-open the database
in the desired mode. Prior to Alpha2, this did not work.
- Try all modes of opening db read-only; verify that you cannot change data, add records,
modify tables or fields, etc.
- Run the test script _RDONLY. This tests opening and attempting to edit with various
When two or more users open a ChemFinder database simultaneously, the open method used
by the first may affect the others. There are three scenarios to consider:
- N Readers. When multiple users access a read-only database, or choose to open one
in read-only mode, they have no awareness of each other. Each can interact as usual with
the database, subject to the limitations of read-only access.
- 1 Writer, N Readers. If one user has a database open for normal access, that user
will have full, normal access, and will not know about any others using the database in
read-only mode. The readers, however, may see data being modified or added as they browse
If reader A is viewing a record when writer B modifies it, the change will be visible
only after A leaves the record and returns to it, or chooses Retrieve All. (We
are working on a scheme to provide automatic notification when a record changes.)
- N Writers. If multiple users have a database open for normal access, then all can
read and write. While browsing, any user may see changes made by another, as described
above. When editing, if two users attempt to edit the same area of the database at the
same time, one of them will be alerted that the database is locked temporarily. (Next
version we hope to have a mechanism for automatic retry.)
[ Note: While we are not yet fully supporting exclusive access, there is
a method for using it to determine whether another user has a database open in any mode.
Try opening a database exclusively, using the following CAL command:
If the database is in use, the attempt will fail. ]
- Test opening, reading, writing, with (a) a single user opening the same db in two forms,
(b) a single user running two ChemFinder sessions on one machine, (c) two users on
- Run the test script _MULTIUSER. This is limited to case (a) above, but does a complete
job of trying all combinations.