Sharing Violation Errors

Last reviewed: 10/16/2009
Article ID: R10751

The information in this article applies to:

SUMMARY

This article discusses common causes of sharing violation errors.

Tabs3 and PracticeMaster software programs generate 3-segment (N-L-C) or 4-segment (N-L-R-C) fatal errors. The first segment of an error (N) is the 4-digit error number (i.e., 1020, 1310, 1450, etc.). The last segment of an error (C) is the error code returned by the operating system. The operating system error code is not always relevant, you know if it is relevant from the rest of the error code. Errors that deal with opening, reading and writing files almost always have a relevant operating system code.

One of the most frequent operating system error codes is error "#32 - ERROR_SHARING_VIOLATION". With this operating system error code, even though the first segment 4-digit error number itself may be different, the operating system error code tells us that the same problems can generate these different errors. 

COMMON ERROR NUMBERS

A sharing violation error indicates the process cannot access the file because it is being used by another process (i.e., the file is in use). Some of the errors that commonly have an operating system error code of #32 consist of the following (but are not limited to):

1020

error opening file

1150

unable to delete file

1310

error opening file

1330

error closing file

1350

error reading file

1390

error searching

1460

error rebuilding index file

Background Information

From a programming standpoint, there are two ways to tell the operating system to open a file: Shared Mode or Exclusive Mode. Shared Mode is used if more than one process will be able to open the same file at the same time (a process is basically a program, either on the same computer or different computers over a network). Each process must use the Shared Mode option or an ERROR_SHARING_VIOLATION will occur. Shared Mode is generally used 95% of the time.

Sometimes Exclusive Mode is required. When using Exclusive Mode, no other processes can open the file regardless of what mode they use. In addition, the exclusive process will receive an ERROR_SHARING_VIOLATION if another process already has the file open (in any mode). Exclusive Mode is used in programs such as Customization, File Maintenance, Back Up Data Files, Restore Data Files, Reindex Files, etc. Exclusive Mode is required to access a file in order to delete it.

What can cause a Sharing Violation?

The following consists of common reasons for sharing violations:

Troubleshooting Steps for Sharing Violation Errors

Unfortunately, Sharing Violation errors can be difficult to troubleshoot because the combination of different versions of Windows along with different networks and different redirectors cause inconsistent errors. 

The following steps represent the standard troubleshooting procedures we provide for Sharing Violation errors.

The Operating System Error Code 32 is "ERROR_SHARING_VIOLATION. The process cannot access the file because it is being used by another process." This is found on the Operating System Errors list.

This error indicates the file is in use.

A file can be opened in one of two modes:  Exclusive mode or Shared mode. If a file is opened in Exclusive mode, no other program can open the file (in either mode). If a file is opened in Shared mode, no other program can open the file in Exclusive mode. Tabs3 and PracticeMaster Programs open data and index files in Shared mode 95% of the time. It is normal for a file such as T3CLIENT.DAT to be open many times. Certain exclusive options, such as Reindex Files, may open files in Exclusive mode. This error indicates the server believes there is a conflict with how the file was opened (i.e., Exclusive mode vs. Shared mode).

References


© 1999-2010 Software Technology, Inc.   All rights reserved. Terms of Use
The maker of Tabs3 and PracticeMaster
Tabs3, PracticeMaster, and the “pinwheel” symbol (The "Pinwheel" symbol is a Registered Trademark of Software Technology, Inc.) are registered trademarks of Software Technology, Inc.
e-Mail Suggestions for the Knowledge Base to: kb@Tabs3.com
Technical Support via e-mail is not available.
Knowledge Base:   http://support.Tabs3.com
Web Site:   http://www.Tabs3.com