ACC2000: "File Sharing Lock Count" Error During Synchronization

ID: Q198633


The information in this article applies to:

IMPORTANT: This article contains information about editing the registry. Before you edit the registry, make sure you understand how to restore it if a problem occurs. For information about how to do this, view the "Restoring the Registry" Help topic in Regedit.exe or the "Restoring a Registry Key" Help topic in Regedt32.exe.

Advanced: Requires expert coding, interoperability, and multiuser skills.

SYMPTOMS

When you synchronize two replicas, you may receive the following error message:

Synchronization between '<Replica1.mdb>' and '<Replica2.mdb>' failed.

File sharing lock count exceeded (Error 3052).
The error may also occur when you run a Visual Basic for Applications procedure that uses the Synchronize method.


CAUSE

A member of the replica set contains too many changes for synchronization to be completed successfully. For example, if one of the replicas has increased in size by 100 megabytes (MB) because you have added a large number of new records, you may receive this error. The replica that contains too many changes may be the database from which you are trying to synchronize, or it may be another member of the replica set.


RESOLUTION

In Microsoft Access 2000, you can take advantage of a feature that allows you to increase the MaxLocksPerFile setting for Microsoft Jet database engine 4.0 by editing the Windows Registry. The default value of this setting is 9500. However, changing this value is not recommended if one of the replicas is located on a Novell Netware server, because the server's maximum record locks per connection is 10000. If both replicas are located on servers running Microsoft Windows NT 4.0 or Microsoft Windows 95 or later, the maximum value of this setting is limited only by available resources.

WARNING: Using Registry Editor incorrectly can cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that problems resulting from the incorrect use of Registry Editor can be solved. Use Registry Editor at your own risk.

For information about how to edit the registry, view the "Changing Keys and Values" Help topic in Registry Editor (Regedit.exe) or the "Add and Delete Information in the Registry" and "Edit Registry Data" Help topics in Regedt32.exe. Note that you should back up the registry before you edit it. If you are running Windows NT, you should also update your Emergency Repair Disk (ERD).

  1. Quit Microsoft Access.


  2. Click Start and then click Run.


  3. In the Open box, type regedit.


  4. Locate the HKEY_LOCAL_MACHINE registry folder.


  5. Expand HKEY_LOCAL_MACHINE until you locate the SOFTWARE\Microsoft\Jet\4.0\Engines\Jet 4.0 folder.


  6. Click on the Jet 4.0 folder to view its contents.


  7. Select the MaxLocksPerFile entry; on the Edit menu, click Modify.


  8. In the Edit DWORD Value dialog box, select Decimal and increase the number in the Value Data box.


  9. Click OK to save the MaxLocksPerFile setting.


  10. Quit the Registry Editor.


  11. Start Microsoft Access and synchronize the replicas.



STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.


MORE INFORMATION

The MaxLocksPerFile setting allows the Microsoft Jet database engine to complete large transactions without exceeding a specified record lock limit. Instead of exceeding this limit, the Jet database engine splits a transaction into two or more parts; after one part has been committed, the Jet database engine frees the locks so that they can be reused. As a result, fewer locks are required to complete the transaction. This prevents a Novell Netware server, which limits the maximum record locks per connection to 10000, from crashing when that value is exceeded.

However, the Jet database engine does not split the transaction when it synchronizes two replicas. If the transaction cannot be completed within the limit specified in the MaxLocksPerFile setting unless it is split into parts, you receive the error described in the "Symptoms" section, and the synchronization does not occur.

Steps to Reproduce Problem

WARNING: The following steps may require up to 400 MB of free disk space. The sample procedure fills a table with a large amount of data; running it may take a long time, during which your CPU is unavailable.
  1. Start Microsoft Access and open a new blank database.


  2. Create the following table:

    Field Name Data Type Field Size
    ID Number Long Integer
    Field1 Text 50
    Field2 Text 50
    Field3 Text 50
    Field4 Text 50


  3. Save the table as tblTable1. When asked if you want to create a primary key, click No.


  4. On the Tools menu, point to Replication, and click Create Replica. When prompted to close the database, click Yes. When prompted to make a backup, click No.


  5. In the Location of New Replica dialog box, note the location and file name of the new replica. Click OK.


  6. Click OK when prompted that the Design Master was successfully created.


  7. Open a new, blank module.


  8. On the Tools menu, click References.


  9. Scroll down through the Available References and click to select the check box for the Microsoft DAO 3.6 Object Library. Then click OK.


  10. Type the following procedure:


  11. 
    Function Filler(lngNumRecs As Long)
        Dim lngLoopCount As Long
        Dim strFillerString As String
        Dim db As Database
        Dim rs As Recordset
    
        strFillerString = ""
    
        For lngLoopCount = 1 To 40
            strFillerString = strFillerString & "x"
        Next lngLoopCount
    
        Set db = CurrentDb
        Set rs = db.OpenRecordset("tblTable1")
    
        For lngLoopCount = 1 To lngNumRecs
            rs.AddNew
            rs![ID] = lngLoopCount
            rs![Field1] = strFillerString
            rs![Field2] = strFillerString
            rs![Field3] = strFillerString
            rs![Field4] = strFillerString
            rs.Update
        Next lngLoopCount
    
        db.Close
        MsgBox "Process Completed."
    End Function 
  12. Save the module as Module1. Type the following line in the Immediate window, and then press ENTER:
    
    ?Filler(500000) 
    NOTE: This procedure may take a long time to run and may require as much as 400 MB of free disk space. After the process has completed, continue on to the next step.


  13. On the Tools menu, point to Replication, and then click Synchronize Now.


  14. In the Synchronize Database '<name>' dialog box, click OK.


  15. Click Yes to close the database and begin synchronization.


A progress indicator with the message "Synchronizing Replicas" appears, but eventually you receive the error described in the "Symptoms" section.


REFERENCES

For more information about MaxLocksPerFile setting, click Microsoft Access Help on the Help menu, type "Initializing the Microsoft Jet 4.0 Database Engine Driver" in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

For additional information about replication, please see the following article in the Microsoft Knowledge Base:

Q214534 Jet 4.0 Replication White Paper Available on MSL

Additional query words: buffer


Keywords          : kberrmsg kbdta GnlOthr RplGen 
Version           : WINDOWS:2000
Platform          : WINDOWS 
Issue type        : kbbug 

Last Reviewed: July 13, 1999