Replicating hard locks

I have an issue with locked documents on replicas.

I have enabled hard locking, and explitly lock and unlock documents in PostOpen/QueryClose events. This is working well.

I have a view that shows all the documents with a $Writers value (ie locked documents, right?).

On local replicas, some documents still show up in my ‘locked docs’ view, even when they do not show up in this view on the server’s replica. Even when I clear replication history, it still does not fix the problem. When a user tries to access one of these documents, it says it is locked…

Why?

Subject: replicating hard locks

If you enabled document locking on the database, what are you doing in postopen, queryclose ?

You should not have to write your own lock/unlock code.

When a user saves a document and the server is available, both replicas are updated to remove the lock details.

Don’t forget there is also a $PWriters field which is the provisional lock set when the admin server of the database cannot be reached (e.g. working in a local offline replica).

Sounds like you might be duplicating the work of the locking mechanism unnecessarily.