Cannot lock current record. record does not exist

I opened up the single file that I have shared. A message stated Synchonized: 2
1 record deleted.
I thought, hmmm, didn’t realized I’d deleted anything. Proceeded anyway.
Ran 1 procedure which essentially does a Select. Then attempted to edit a record buried within the database (not the 1st record). The result was an error 'Cannot lock current record. Cannot lock - record does not exist.
Tried File/Synchronize Data.
Result: “Already synchronized: 2”
Tried Record/Duplicate Record
A duplicate was created and I then deleted the original ‘corrupted’ record with the warning that it was not undoable as the file was shared but I said fine, go ahead and delete it.
Moving forward.

10.2.0.b12

I posted a message to Jim Rea about a similar experience yesterday, but today I can’t find it. ??

It was about a few record locking issues that I encountered between two machines. I’ll try to recreate my report.

You and I are both on Big Sur if that might be a factor

Tis interesting that immediately after opening a file, and getting a notification message stating ‘Already synchronzied: 179’, that if I attempt to edit a record I should get an error ‘Cannot lock - record does not exist.’

As for the ‘Already synchronized: 179’, I’m wondering what that 179 number is as I’ve opened and closed this same db repeatedly saving after each open and close with nothing happening but my attempt to edit a single record.

My ability to move forward continues to be Duplicate Record, then edit the new record and delete the old damaged record.

Hi Robert, did you figure out what this message means?

That is the internal server count the server uses to determine in what order modifications were made. It increases every time there is a change submitted to the server. Displaying that number was handy for debugging but I should probably remove the display at this point, it’s just confusing. There are some other notifications that are TMI as well.

After restarting Panorama, I then open a file and get the desired ‘all is ok’ dialog.

Already Synchronized

But then when I attempt to edit a cell, I get a ‘no go’ error message.

We experienced this exact problem periodically for several months, but it has not occurred in over two months now. That is, a client computer has a record that is not on the server and normal syncing does nothing with it. To investigate this, I would find out the server record id (info(“serverrecordid”)), and then search the server log to see what it reports about this record; when was it added, and what, if anything, was done with it since then. This might give some clues to how this situation, which theoretically should never occur, came about.

I predict that if you do a ‘Download Data’ that the record will disappear from the client. If you want to save the record, you could do a copyrecord/pasterecrod and then delete the original un-synced one. But I think also that there is a statement specifically to deal with this situation, uploadrecord. I don’t think I have ever used it.

Let us know what happens and what you can learn about this problem.

When I open a shared database, I get the comforting 'Already synchronized with ‘Server Name’ notification. But then later, when attemtping to edit a record, I get the…
"Cannot lock current record
Cannot lock record: ‘record number’ in database: ‘db Name’ (record does not exist)
I’ve learned that I can use the Option key with the Records menu and then choose ‘Upload Record’ as a quick fix, but my mind then goes to ‘Hmmm. What other records do not exist?’. Is there a way to determine if there are other records that ‘do not exist’?

If I open a shared database, and it shows the Summary records that existed when I last closed it, does that indicate a problem?
I do have the Wi-Fi icon which tells me that it is shared.
If I run this code…

Local LStatus
CheckServerConnection "Automation 21",LStatus
Message ?(LStatus=-1,"Automation 21 is 
Connected","Automation 21 is not Connected")

it tells me that it is connected but I am not getting the ‘Already synchronized with …’ when I first open the database.
And what brings up these questions is that I am continuing to get the Record does not exist when I attempt to edit some records. I have tried the File/Synchronize Data menu item and it says that the file is synchronized but the retention of the Summary records and the record not exist issues confound me.

That would be normal if someone else has deleted this record after you synchronized.

If I open a shared database, and it shows the Summary records that existed when I last closed it, does that indicate a problem?

If no changes were made to the database since the last time you synchronized, this is normal.

Using b25, I received the 'Already synchronized with ’ message. The when I attempted to edit a record, I then got
Panorama Error
error.

All records were locked. The fix was to use Database Options and pretend like I wanted to do a new generation. Upon then later doing the New Generation, all seemed to be good to go.

That is a very odd message. Record numbers start with 1, there is never a record 0 in any database.

Another 'Cannot lock record: 0 in database.

We have a Download Record from Server. I’m wondering if we need an ‘Upload Record to Server’? My currrent ‘fix’ is to use ‘Duplicate Record’, then delete the original record.

Now there’s a thought.

Note: This was covered in one of the sessions last spring.

That worked for me just now in a database of 5 records where the 5th kept being declared as non-existent.

Another trick for the ‘record does not exist’ is to ‘Record/Duplicate Record’, then delete the original record. The duplicated record is fully functional.

I should probably change the “record does not exist” message to “this record has been deleted by another user”.

But these records were not deleted by another user.

That should be the only way this message should ever occur.

The server keeps a list of deleted records. I’m going to modify the code so that if it cannot find the specified record, it checks the list of deleted records. If it finds the requested records in this list, it will display the “deleted by another user” message. If the record is not on the deleted record list, it will display a message that the database is damaged, and that you probably want to do a new generation of the database. If that starts turning up regularly that would indicate that there is a bug that needs to be tracked down.

Note: Panorama 6 server used to spuriously produce record deleted by another user errors. It turns out that this would happen if somehow a subset of records was selected on the server, it can be fixed by manually doing a select all on the server. I discovered the cause of this so late (2014?) that I was no longer able to fix the code. However, this should not be the problem in Panorama X, since it checks to make sure all records are selected before searching for the requested record.

In my case today, I had just shared a former Panorama 6 database with 5 records. I am the only user. In the DataSheet, I went from the top to the bottom making a change in one field. When I got to the last record, I got the message that the record did not exist and I couldn’t change it. No one deleted anything.