Skip to main content
Skip table of contents

What is a file lock and what does it mean?

This support note applies to:

  • AE System Release (AU)
Article ID: 28772

File locks are a mechanism built into Microsoft Windows so that software written for Windows that shares a file may control access to all or part of a file.

These work by only allowing one user at a time to acquire a lock over any part of a file. Once a lock has been acquired, the owner is able to access and update that part of the file without interference from other users. If a lock cannot be acquired because another user already has a lock, then the software will usually advise the user of this circumstance. This most commonly occurs when another user tries to access a file someone else is already using, but can also be caused by tools such as Anti-virus scanners, which check file contents. The way in which file locks behave can be dependent on the Windows operating system settings. 

Why are MYOB AE files locked?

System Release based applications always lock an area of a data file prior to accessing or updating. This is to ensure that while the file is being accessed no other users can interfere. This is necessary to ensure that the data integrity of the system is maintained and that data is not incorrectly overwritten during the updating process.

Once the file access, either for reading or writing, is complete the lock is released and other processes can now access the file. The whole process should only take a fraction of a second at the most, and ordinarily, is not seen.

When do file lock messages occur and what does it mean?

If the MYOB AE software attempts to acquire a lock over an area of a data file that has been already locked by another user, then the MYOB AE software will wait for one fifth of a second and then try again. If, after 12 seconds or so, the MYOB AE software has still been unsuccessful at acquiring the lock, a file lock message is displayed. Displaying this message gives the system time to allow the file lock to be released by the other processes that are accessing the file. It is not an error as such.

What are the most common causes of file locks?

In our experience, these are the 4 most common causes of file lock messages within MYOB AE programs:

  1. Many other users within MYOB AE software are attempting to simultaneously access the same file, which has the effect of keeping the file locked for an extended period of time
  2. The operating system has not released a lock on a file when it is expected by the application, as is the case when opportunistic locking is enabled on Windows Operating Systems. Opportunistic locking can be switched off. Detailed steps is available within Turning off opportunistic locking.
  3. A third party process (such as an Anti-virus scanner or a backup routine) is processing the file at the time you are trying to update it and
  4. Recent software service packs for the Operating System, Network drivers and MYOB AE have not been applied and therefore the server is not operating optimally.

For details on recommended environments refer to MYOB System Requirements. The latest service packs for operating systems and network clients are available on the vendors' support websites.

What should I do when I get a file lock message?

Always select OK or retry to a file lock message, as the data file may have been released in the interim. The application will then attempt again to acquire the lock. In most situations, unless someone is conducting very heavy processing on that particular data file, you should be successful on the subsequent attempt.

Always avoid crashing or selecting Control-Alt-Delete to exit the file lock warning, as this may result in data corruption. If anyone in your practice does exit in this way, you are advised to initiate immediate checks on the integrity of your database.

If file locks are occurring regularly in your practice, ensure your network setup meets the MYOB System Requirements and Certified Environment Listing. Also you should consider consulting a qualified network engineer to conduct a "health" check of your network if you do not already do this on a periodic basis. On both Windows and Netware it is possible, as an administrator, to see which file is open and by whom at any time. Please refer to the specific vendor product documentation for more information.

If you are still experiencing problems or have any questions about this article, contact MYOB Support.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.