John Murray · Aug 15, 2017 go to post

Pedro - good to see that DC members were able to help. Now please set the "accepted answer" checkmark that only you (as OP) are able to set. If you're unsure where to look, see my screenshot below:

John Murray · Aug 14, 2017 go to post

Maybe worth adding that the two MS packages can be run with command line options suitable for unattended use, e.g.

vcredist_x86.exe /passive /norestart

For a dialog box showing all the command line options:

vcredist_x86.exe /help

or

vcredist_x86.exe /?

I wish an unattended install of Cache would install these runtime prerequisites automatically for us. I think it does that when doing an interactive install, which would imply that the vcredist_x*.exe kits are already bundled inside the cache*.exe installer.

John Murray · Aug 14, 2017 go to post

Adding to the other answers, I notice the OP wrote "I need my globals unreadable if other process is in critical area".

This means you will need to obtain LOCKs before referencing (reading) the globals. But in this case you might opt to request shared LOCKs, e.g.

LOCK +(^A#"S",^B#"S",^C#"S")
WRITE !,"^A=",^A,!,"^B=",^B,!,"^C=",^C,!
LOCK -(^A#"S",^B#"S",^C#"S")

The use of shared locks will allow multiple concurrent reader processes, while still blocking all readers if a writer holds conflicting locks. A would-be writer will also be blocked while any readers still hold conflicting locks.

John Murray · Aug 14, 2017 go to post

You can use a 0 second timeout on the LOCK command. That way your process will proceed immediately and you can check the value of $TEST (either directly, or indirectly using the ELSE command or an argumentless IF) to discover if you got the lock(s) or not.

John Murray · Aug 11, 2017 go to post

When processing the two pieces of a timestamp such as $ZTS it is safer to assign the timestamp once to a variable, then operate on that variable, e.g.  instead of

W (+$ZTS-47117*86400) + $J($P($ZTS,",",2),0,0)

use

S zts=$ZTS W (+zts-47117*86400) + $J($P(zts,",",2),0,0)

This avoids the edge case in the original code, where the first evaluation of $ZTS happens just before the midnight rollover and the second evaluation at or just after it.

John Murray · Aug 11, 2017 go to post

This continues to happen with 2017.1.1 when doing an unattended install. I have opened ticket 886059 with WRC about it. Turns out I had overlooked this note in the doc:

Important:

Before using the Caché unattended installation utility, you must download and install the Visual C++ Redistributable Packages for Visual Studio 2013 from Microsoft (https://www.microsoft.com/en-us/download/details.aspx?id=40784). If you are installing on a 64-bit system, you must install both the vcredist_x86.exe file and the vcredist_x64.exe file.
John Murray · Aug 11, 2017 go to post

Looks like those two have now been removed as well sad. Perhaps I should have stayed quiet!

John Murray · Aug 11, 2017 go to post

Did you find it? The checkmark has now been set.

Any suggestions about how to make this facility more obvious to posters?

John Murray · Aug 11, 2017 go to post

Eric, to mark your question as "answered" on Developer Community, please click the checkmark alongside the answer you (as author of the question) accept.

I'd also like to draw your attention to DC's facility for commenting on an answer (which is what I'm doing here). It's probably not obvious enough, meaning that you response to Alexander displays as a second answer to your original question.

John Murray · Aug 10, 2017 go to post

Yes, Control+R works, and so does clicking on the browser's reload button.

But it seems I still have a couple of options for clicking on the DC homepage:

At least, until you remove those frown

John Murray · Aug 10, 2017 go to post

Interesting. I wonder if you're still using an older copy of DC somehow. The screenshot I posted was from Chrome version 60.0.3112.90 (Official Build) (64-bit) on Windows.

Does it still work if you clear your browser cache?

John Murray · Aug 10, 2017 go to post

It's a very long time since I used GBLOCKCOPY on a Cache 5.0 system, but I think you may be able to simplify your steps.

1. Create a new temporary database via Configuration Manager. You probably don't need a new namespace as well.

2. Use GBLOCKCOPY to copy your old database contents into your new database.

3. Dismount your old database and your new one. Or just shut down Cache completely.

4. Rename your old database (the big one), e.g. to CACHE.oldDAT

5. Move the temporary database's CACHE.DAT file to where the old one was.

6. Mount your database (or start Cache).

7. Use Configuration Manager to delete the temporary database you defined in step 1.

8 Check everything is working.

9. Delete the renamed big database file you preserved in step 4.

10. Come back to DC, tell us how it went, and set the checkmark against one of the answers to show you have accepted it.

John Murray · Aug 10, 2017 go to post

Expanding on the earlier answers by Eduard and Robert:

A process will not be able to switch to a namespace (e.g. with Do $ZU(5,ns) or ZNAMESPACE ns or Set $NAMESPACE=ns or via Do ^%CD) unless the user holds the Read privilege on the database resource of the default globals database associated with that namespace.

To read about this, see the "Namespaces" subsection of this doc section.

John Murray · Aug 8, 2017 go to post

Good to hear. Now please set the checkmark alongside Jamie's original answer, so your question shows in DC as having been answered.

John Murray · Aug 8, 2017 go to post

Doc for 5.0 is available at http://docs.intersystems.com/documentation/cache/cache5docs/

At the bottom of that page I found this:

Using the Caché GBLOCKCOPY Routine —  This article describes the basics of running GBLOCKCOPY to copy globals.

The link is to a PDF. One of the use cases in the PDF is as follows:

Reclaim unused space in a database
If a large global is created then killed in a database, there may be a large excess of unused space in the database. This space can be removed by copying all the globals in the database to a new one, and then replacing the old database with the new database.

That's what I think you need to do. It sounds like you used GBLOCKCOPY to copy to a namespace in an existing database rather than to a fresh empty database.

Of course, you will need enough disk space to have the smaller new database alongside the big database until you have completed the copying.

John Murray · Aug 7, 2017 go to post

Luca, any reason for recommending %Exists and having to use $LISTBUILD when you could go direct to %ExistsId ?

John Murray · Aug 3, 2017 go to post

I don't know of a way to alter the trace output of ZBREAK. But have you considered using Serenji to help with this debugging task? Its ability to break when an expression's value changes may be helpful.

John Murray · Aug 3, 2017 go to post

So I've used my moderator superpowers to correct the first line of the post.

John Murray · Jul 31, 2017 go to post

Please show us the code that is writing the output. Also, tell us what your $zversion variable reports, and what platform you are running Cache on.

John Murray · Jul 20, 2017 go to post

CHARWIN might be useful. But if you're extending an existing terminal-based application you may want to work the way the existing code does. And if you're starting a new application, is a terminal-based UI still the right way to be going?

John Murray · Jul 18, 2017 go to post

Rubens, your rule #2 says " Argument index starts from 0" but in your example the index starts at 1.

John Murray · Jul 17, 2017 go to post

Take care that you don't unintentionally kill globals that may be visible in this namespace because of global mappings.