TOPIC
My Power Macintosh 9500/150 computer freezes when I try to "Close Locks" in Microsoft's FoxPro with File Sharing turned on. The computer fails during the lock process when trying to lock the 221st record. The same computer can then be restarted with the Shift key held down, which turns extensions off, and more than 220 locks can be closed.
DISCUSSION This error is a result of a toolbox call to PBLockRange receiving return code -5015, which means a server cannot lock any additional ranges. This toolbox call is primarily used by database application to ensure integrity of file updates, by selectively locking a range of bytes, typically a record's worth, while an update write operation takes place. This toolbox call only has meaning when applied to a file on a server volume or a local volume which is shared. Thus when the computer is booted with extensions off, no AppleShare activity like File Sharing or mounting of servers can happen. The call to PBLockRange is ignored since there is no integrity exposure of multiple shared access. This would explain why the error does not occur with extensions off. "Inside Mac" does not state a limit for simultaneous ranges to be locked, presumably because it can change with the environment (File Sharing, AppleShare Server, Netware) or future implementations. It would appear that Mac OS File Sharing has a limit of 220 ranges that can be locked. Other implementations of AFP (AppleTalk Filing Protocol) could have other maximums. In talking with Microsoft, they mentioned that this issue was solved with their Visual FoxPro 3.0 product. If you want to determine the number of locks, here is a FoxPro program that can be used to determine the maximum number of locks in the File Sharing environment. ======== Begin Code Below ======================================== SET STATUS ON USE SYS(2004)+"Tutorial:Customer.dbf" SHARED SET MULTILOCKS ON DO WHILE !EOF() AND RLOCK() SKIP ENDDO ======== End Code Above ========================================== This program sequences through every record in the database and locks the record, until range locks are exceeded or all records are locked. The database specified, Tutorial:Customer.dbf, is an installed FoxPro sample database or it could be your database. To determine the maximum for a server, there must be enough records in the database to exhaust all available range locks. |
Document Information | |
Product Area: | Apple Software |
Category: | Third-Party Software |
Sub Category: | General Topics |
Copyright © 2000 Apple Computer, Inc. All rights reserved.