Professional Documents
Culture Documents
There are two ways to share IMS Option databases between multiple users. Which technique you use
depends on whether the database being shared is to be updated or not. This chapter describes the sharing of
IMS Option databases which can be updated.
2.1 Overview
Sharing databases for read-only is much simpler than shared update databases. It only requires copying the
database data files to a server folder and setting Shared read-only databases on the IMS page of the
Project Settings dialog box to indicate the shared folder. There is a smaller overhead for read-only
databases because there is no requirement for locking and unlocking of records and updates do not have to
be logged for a possible rollback. See the section IMS Option Settings in the chapter Advanced
Customization for further information.
The Mainframe Express Fileshare component provides support for shared update databases - hence the
name Fileshare databases. Fileshare databases support database record level locking and dynamic rollback.
Database record level locking ensures no one can update or retrieve segments which are in use by another
user. In theory, shared update databases could be supported by locking entire databases but this would
cause prohibitive performance in long-running transactions, such as when debugging a program. It could
also cause high levels of unnecessary data contention even for short-running transactions, such as in a
system test phase.
You can use Fileshare to configure databases for use in single-user mode. This can be helpful for testing
checkpoint and restart logic in batch programs.The processing IMS Option performs is the same between
single-user and multi-user access. You need to set up both the client and the server components, however,
setup is easier because they are on the same machine and there is no network communications protocol
required.
The rest of this chapter describes configuring and using Fileshare databases. You should read the chapter
IMS Syncpoint Coordination for related issues.
When a lock request is made, if someone already has a lock on that record, the Fileshare server
checks how long the original lock holder has been inactive, that is, how long it was since the
original lock holder made a request to the Fileshare server. If it is longer than the specified
timeout, the original lock holder is rolled back and all locks are released and the new lock request
is granted. If the original lock holder makes a request to the Fileshare server, IMS Option displays
a window indicating that the timeout has expired and that the transaction is rolled back.
Your first reaction might be to set the timeout value to a very large value so that you are not rolled back in
the middle of a transaction. However, if you set it to be too long, you might lock yourself (or somebody
else) out for the timeout period. This is easier to describe with an example. Supposing you made some
IMS Option Fileshare database updates while debugging your program and accidentally switched off
power to your PC. Fileshare would not detect this and so retains your locks. Then, you power up and start
debugging the same program which would cause a lock request to the same records you had locked before.
The lock request would not be granted as you appear to be a new user to Fileshare. The lock request would
be re-tried until the timeout expired. When it expires, your previous locks are released and updates are
rolled back. You will then acquire a new lock. Database integrity has been maintained but you have been
locked out for the duration of the timeout period.
You must be careful when setting the timeout value: if you were debugging a program, it may be a fairly
long time between database requests so you must set this timeout to reflect a long enough period so you
are not rolled back while working. But, setting it to a very long time period can result in long lock out
periods after a hard failure.
• Lock strategy "2" in which all Get calls obtain the same level of lock while any update call causes
an update level lock The advantage of this strategy over lock strategy "3" is that it needs less
computer resource, so possibly less time, to acquire and release the locks - it is also slightly
easier to setup and administer. This strategy may provide the best performance if the
transactions are very short or different users do not often access the same database records.
• Get and Insert call locks are only granted if no other lock is outstanding against the
database record
• Replace and Delete calls only change the lock level and are always granted
• Get call locks are released if the database record is no longer needed for database
position
Although this provides for database sharing, it does not provide very well for database record
sharing. That is, with this strategy only one person at a time can access a particular database
record.
• Lock strategy "3" is more sophisticated and is more like the locking performed by IMS/ESA. This
requires using the IMS Option Supervisor and is explained in the next section.