This code isn’t making the database secret - it’s checking to see if it is secret. Here’s how it’s doing that.
let secretDatabase = targetDatabase<>windowinfo("","Database")
zlog "secretDatabase: "+boolstr(secretDatabase)
I’m not sure what you mean by “secret references”, but somehow the ChoresDB was not the active window when this was called. Maybe I should add instrumentation to show what the active window actually is, though the following code is supposed to work no matter what the window is.
You can also see that this is true. The client contacts the server to find out if it needs synching - the client currently has the database up to time stamp 1602.
[CLIENTSYNC] hostDatabaseName: ChoresDB on hostServer: XXXX
[CLIENTSYNC] sessionID: 176
[CLIENTSYNC] hostDatabaseID: F8419986-89F5-4779-B609-5B6D4787EB8F-65634-00001C0A2B4C1862+3814188341
[CLIENTSYNC] lastSyncTS: 1602
The server replies that time stamp 1602 is the most recent time stamp - in other words, the database hasn’t been modified since the last time this database was synchronized.
[CLIENTSYNC] === DICTIONARY xreply ============
[CLIENTSYNC] STATUS="OK"
[CLIENTSYNC] DELETEDRECORDS=""
[CLIENTSYNC] SYNCTIMESTAMP=1602
[CLIENTSYNC] LOOPBACK=""
[CLIENTSYNC] === END OF DICTIONARY xreply ============
I’m guessing you are thinking that this means that the open didn’t complete, however, that is not what this means. The CLIENTOPENSHAREDDATABASE code is called in two situations - when opening a database, and when using the CONNECTTOSERVER statement on a database that is already open. In the latter case some steps need to be skipped, for example running the .Initialize procedure. OpenComplete will always be false when opening the database, and always be true when using connecttoserver.
WaitForTask is not even going to be invoked unless a synchronization of a large amount of data is needed. It does the waitfortask while waiting for the large amount of data to download. In this case, no synchronization is needed, so no waitfortask.
Bottom line, unfortunately I don’t see anything in this log that provides a useful clue.
All this is being called by a timer? I wonder if that is a clue.
Are these databases so large that you can’t keep them all in memory all the time? These days that would be very unusually large. Seems to me like a lot of hassle could be avoided by opening the databases once when you start up, and leaving them up all the time. Just synchronize before generating the PDFs. But I’m not familiar with your application, so maybe there’s something I’m not understanding. Of course 30 years ago memory was dear and we wouldn’t do that sort of thing, but times have changed.