It’s not consistent, but after running the short code below in several databases, I found that frequently
_PanoramaLib became the active file.
zlog dbname()
wait 1
zlog dbname()
[Time Log/Procedure_A] Time Log
[Time Log/Procedure_A] _PanoramaLib
It’s not consistent, but after running the short code below in several databases, I found that frequently
_PanoramaLib became the active file.
zlog dbname()
wait 1
zlog dbname()
[Time Log/Procedure_A] Time Log
[Time Log/Procedure_A] _PanoramaLib
I cannot duplicate this, and looking at the source code I cannot see any reason why this would happen.
The WAIT statement does have built in instrumentation. You can enable it from the preference panel.
Once you do that the instrumentation will show a lot more information, perhaps that will provide a clue. Here’s an example of the ouput I saw.
[Kurt Arnlund Experiments/Alert events] Kurt Arnlund Experiments
[WAIT] delay: 1
[WAIT] delayScope: database
[WAIT] delayBackground: no
[WAIT] taskid: 4CEF8132-EB42-4B85-99D3-4825028B6381-29168-0000037446937149
[WAIT] === DICTIONARY timerinfo("delay"+taskid) ============
[WAIT] NextRunTime=3805110999
[WAIT] Interval=1
[WAIT] Name="delay4CEF8132-EB42-4B85-99D3-4825028B6381-29168-0000037446937149"
[WAIT] Suspended=0
[WAIT] RunInBackground=0
[WAIT] RunCount=0
[WAIT] Window=""
[WAIT] MaxCount=1
[WAIT] Locked=-1
[WAIT] Database="Kurt Arnlund Experiments"
[WAIT] Error="Notify"
[WAIT] RunIfConnected=0
[WAIT] Code="// Code unavailable (timer locked)"
[WAIT] === END OF DICTIONARY timerinfo("delay"+taskid) ============
[Kurt Arnlund Experiments/Alert events] Kurt Arnlund Experiments
You can also look at the source code for the WAIT statement, it’s open source.
Did you have any other timer tasks running at the same time? I did try running the Server Administration window in the background with it updating every second, but that did not cause any problem.
Before posting the other day, I ran the same process on two different computers and in different databases, shared and un-shared. After your response, I ran it several times without the _PanoramaLib showing up. Today I just ran it and again, and on the very first run there’s _PanoramaLib
Running it another few times, it showed the desired database name. So, as I had noted it is not consistent.
Enabling logging on wait showed nothing since it was working properly at the moment.
FWIW, this one is a shared file, but…
On a second computer, I created a new Untitled database and ran the procedure with Instrumentation activated on wait and got the error:
Back on the first computer with another new Untitled database, I ran it over and over by clicking on the Run button. Much of the time, it returns the right name. Every once in a while it does not.
Adding a loop of 30 times turned out to be a seemingly surefire way to reproduce it, but a loop has not been involved previously. And, of course, the Untitled databases are single user with the same results whether saved or unsaved.
Unfortunately, you haven’t provided any additional information that allows me to duplicate the problem.
It’s probably a clue that _PanoramaLib is always the database you are getting. In fact, based on your screen shot, _PanoramaLib IS the active database. The Instrumentation Log window is in _PanoramaLib, and in your screenshot that is the active window. Of course maybe it wasn’t the active window when you ran the code, you might have switched to that window to take the screenshot.
I’m going to suggest that you close the Instrumentation Log, and instead monitor the instrumentation with the Terminal or with BBEdit, or the Console. Or just open the Instrumentation Log window after you run the program, instead of having it open while the program is running.
Other windows that are in _PanoramaLib include:
Make sure all of these are closed and see if you still have the problem.