Re: multiple file access in CISAM
Posted in 1992
Topics: General Discussion
>If a file is being accessed at more than one point is there an easy >way to synchronize the accessing? Is it possible to save isrecnum >following access and use that to start a *logical* access on another >isfd? Yes, the isrecnum values are valid using any file descriptor, provided that the record is still in the file. > It appears that isstart() may be called to set the physical >record number, is it possible and reasonable to continue a logical >access following that access?. You can use the isrecnum returned from an isstart on one file descriptor to access records through another file descriptor. But, the 'context' (current record pointer + index) will probably not be valid in the other file descriptor. You will need to do an isstart on the other file descriptor as well (but you can use the isrecnum value that you already have). > If the foregoing is possible, what >happens if the record pointed to by the saved isrecnum is removed >or modified in the meantime? The record number doesn't change on update, but if the record is deleted, you will get an error. >If the file is being accessed using 2 different isfds will record >locking function between the 2 handles? Is it possible that accessing >a record locked on one channel using the second channel will block? >Could it free? C-ISAM locking is by PID, not by file descriptor (at least in version 3.10). This means that accesses by the same process through different file descriptors will never conflict (ie. a single process will not block on a lock it holds through a different file descriptor). If you want locks obtained through different file descriptors to conflict, you have to use different processes. Incidentally, C-ISAM also allows a process to open an exclusive file descriptor while having the file open in shared mode (ie. a process can open a file twice: once in shared mode, once in exclusive mode). The only time an exclusive open fails is when a different process has the file open. This is a 'feature' of C-ISAM that bothers me a lot. If anyone reading this message likes or uses this feature, I'd like to hear from them. Ed Engler