Sharing Violation Errors
Last reviewed: 10/16/2009
Article ID: R10751
The information in this article applies to:
- All Version 15, 14, 12 & 11 Products
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:
- Resetting Computers - Tabs3 and PracticeMaster software products
include a Reset Users utility
that can be used in the event a user does not exit the software properly
(i.e., power outage, lockup, improper shut-down, etc.). Unfortunately,
sometimes users will use this utility without having other network users
exit the software thus resulting in active users being reset. This can cause data
integrity problems as well as fatal errors. If a user resets another user that has a file
open, a sharing violation may occur for any user who attempts to run a
process that needs to open the already open file in Exclusive Mode. This
situation is possible because the program believes the file to be not open
because the user is no longer in the active user list because the user was
reset. We recommend that all users be instructed to always shut down
properly. Furthermore, the reset option should only be used when users are
unable to exit the software properly. Only managers can reset users.
Additional information regarding resetting users can be found in the online provided with the software, and in
KB Article R10789, "Resetting Users."
- Backup Software - Most external backup software will lock files
while backing them up, which can cause sharing violations. It is important that
external backups only be run while no users are actively using the
software. KB Article R11213, Backup Strategy,
contains helpful information regarding what to consider when establishing your
backup policy. Note that Client Server Versions (CSV) of Tabs3 and PracticeMaster
can create a HotBackup of your data files while users are actively using the
program, without locking any working files. See KB Article
R11193, "HotBackup Overview" for information about
this feature.
- Virus Checking Software - Some Virus Checkers seem to cause Sharing
Violations. KB Article R10760, "Antivirus Software Information," provides additional information regarding issues with antivirus software.
- Lost Network Connections - Workstations that have lost their
connection to the file server can cause a sharing violation. This is because the file server mistakenly thinks the
workstation still has files open.
- Novell Client32 Connector - Different versions of CLIENT32 have had
problems with reporting bogus Sharing Violations back to the operating
system. Novell's Web site (http://support.novell.com)
has many articles regarding these problems. Most of the problems appear
to have been
ironed out with the latest versions. Disabling the Opportunistic
Locking option on CLIENT32 seems to help in some instances. KB Article
R10200, "Redirector Problems and Other Network Problems," includes
detailed information regarding Novell Client 32 Connectors and how to
disable Opportunistic Locking.
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).
Check for unexpected open files.
Causes
This error may be a one-time only error or a recurring error. Troubleshooting steps vary depending on whether you simply want to get up and running as quickly as possible or you want to determine why these errors are occurring.
Our recommendation is to always determine causes of errors whenever possible. Common causes of unexpected open files include but are not limited to:
- Someone may have reset user(s) in the Tabs3/PracticeMaster software (R10789).
-
Other software may have files open, such as:
- Antivirus software - Make sure the Tabs3 program directory is excluded
from continuous virus scanning (R10760).
- External backup software - Make sure backups are not being made while
anybody is using the Tabs3/PracticeMaster software. Additional precautions
are required for Client Server Version (CSV) software (R11213).
- Disk shadowing software or other software.
- A workstation may have frozen up on the network.
Detailed information regarding what causes these errors can be found in R10751,
"Tech Tip: Sharing Violation Errors".
Troubleshooting Steps
Any of the following steps may be used to troubleshoot this error:
- Try the task again. If the open file was due to other software using the file, the file may no longer be open.
- Check the Reset Log. Determine whether any users have been reset recently by checking the Reset Log file (View | Log Files | Reset Log).
- If reset user(s) are found, verify the user(s) that were reset are not still in the software.
- If the user(s) that was reset is frozen, then end the program. Use the Task Manager if necessary.
- Nobody should use the Tabs3/PracticeMaster software until the reset user has exited.
- After the reset user(s) have exited the software, have the reset user(s) either:
- Log out of the network and log back in; or
- Reboot and log back into the network.
- Try the task again. If the error no longer occurs, run a Data File Integrity Check to ensure there are no errors in the data.
Note: Detailed information regarding the consequences of resetting users can be found in
R10789, Resetting Users.
- Check the Error Log. Determine whether any users have had any problems on the network or in Tabs3 by checking the Error Log file (View | Log Files | Error Log).
- For users who have recently had problems on the network, verify that those users are not still in the software.
- If the user(s) that had problems is frozen, then end the program. Use the Task Manager if necessary.
- Nobody should use the Tabs3/PracticeMaster software until those user(s) have exited.
- After those user(s) have exited the software, have the user(s) either:
- Log out of the network and log back in; or
- Reboot and log back into the network.
- Try the task again. If the error no longer occurs, run a Data File Integrity Check to ensure there are no errors in the data.
- Check the file server for open files.
- KB Article R10028 contains information on how to check for open files on Windows servers. KB Article R10181 contains information on how to check for open files on Novell NetWare.
- DO NOT close the open files using these utilities. Once you determine which files are open on which workstation, have those workstations either:
- Log out of the network and log back in; or
- Reboot and log back into the network.
- Try the task again. If the error no longer occurs, run a Data File Integrity Check to ensure there are no errors in the data.
- Note: Be aware that the above techniques only find files that were opened on the server across the network. They do not find files that were opened by programs running locally on the file server (e.g., CSV components, antivirus software, etc.) You may need to use a utility that checks for locally opened files on the file server such as Process Explorer (see Microsoft KB How to Article 242131, Display a List of Processes That Have Files Open).
- Restart STI Server and the Director. If using the Client Server Version (CSV), try restarting the STI Server and the Director.
- After rebooting, try the task again. If the error no longer occurs, run a Data File Integrity Check to ensure there are no errors in the data.
- Reboot all workstations. Keep in mind that simply rebooting the workstation does not close the file it opened on the file server; logging back into the network closes the open file.
- If using Terminal Services, reboot the Terminal Server.
- After rebooting, try the task again. If the error no longer occurs, run a Data File Integrity Check to ensure there are no errors in the data.
- Reboot the file server. Although rebooting the file server will close any open files, it is typically not a practical troubleshooting step when other courses of action are available.
- After rebooting, try the task again. If the error no longer occurs, run a Data File Integrity Check to ensure there are no errors in the data.
References
- KB Article R10044 - How to Interpret Fatal Error
Messages
- KB Article R10307 - Operating System Error Codes
THE INFORMATION PROVIDED IN THE SOFTWARE TECHNOLOGY, INC.
KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. SOFTWARE
TECHNOLOGY, INC. DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR
IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE. IN NO EVENT SHALL SOFTWARE TECHNOLOGY, INC. OR ITS
SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT,
INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN
IF SOFTWARE TECHNOLOGY, INC. OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR
LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE
FOREGOING LIMITATION MAY NOT APPLY.
© 1999-2010 Software Technology, Inc. All rights
reserved. Terms of Use
The maker of Tabs3 and PracticeMaster
Tabs3, PracticeMaster, and the “pinwheel” symbol (
) 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