Clearing Clarify Cache Files
This will probably be old news to most of you, but there’s always new people getting exposed to Clarify, so I figured it couldn’t hurt to share.
If you’ve worked with the Clarify Classic Client for any amount of time (say, more than a day), you’ve probably run into the scenario where things start to misbehave. Often, this is because the Clarify cache files get corrupt. The fix is to delete those cache files, and restart the app. The cache files will get rebuilt during app startup.
What gets cached?
Mostly what gets cached is:
- Schema (data from the ADP tables) is cached in the <databaseName>.0XX file, where XX is your schema revision. Example: testdb1.062
- Forms and other metadata is cached in the <databaseName>.cfy file. Example: testdb1.cfy
- ClearBasic Code is cached in a boatload of files in the CBCache directory
If you look in the Clarify Client’s working directory, you’ll see these files and directories in there.
So, when something goes wrong, we want to delete these files.
Anything else we should delete?
I’ve also found it helpful to delete the log and output files that are created by Clarify. I’ve seen some strange behavior that is only resolved when deleting those log and output files.
These include:
- server.log
- standard.out
- cbex.log
Script it
Since deleting these files needs to happen occasionally, folks typically create a script that makes it easy (especially for end users) to clean up their cache files.
Batch script
I use a simple DOS BAT file for this task.
And I trigger this BAT file using an alias I’ve setup in SlickRun.
VBScript
One of our customers (Ken S.) recently shared a VBScript that he created to delete cache files.
Encrypt that Script
In order to prevent end users from hacking the VBScript, Ken encrypts it using the Microsoft Script Encoder tool. Script Encoder is a simple command-line tool that enables script designers to encode their final script so that clients cannot view or modify their source. Pretty slick.
So users end up with a clear_cache.vbe file. They just double-click it to run it, it deletes the cache files, and gives them a message box that tells them that it Deleted the Clarify Cache Files. Nice.
I didn’t know you could encrypt script files. Looks like the Microsoft Script Encoder allows you to encrypt VBscripts, Javascripts (JScript), as well as ASP and even HTML pages. Cool.
Wrapper around Clarify
I’ve also seen other customers who write a wrapper app/script that wraps around clarify.exe. This wrapper script is how users start the Clarify app (as opposed to starting clarify.exe directly). This wrapper script deletes all of the cache files, and then starts the clarify app, allowing each login of clarify to start with fresh cache files. I’m not a big fan of this approach, as you lose the performance gains of having the cache files to begin with. But, if they’re getting corrupted frequently, it might be worth it.
Summary
So there you go – a couple of working examples on how to make it easy for you and your users to delete those pesky Clarify cache files. (and even encrypt the script if you like!)
What about you? Have another approach that you use? A different script? Something else entirely different?
Let’s hear what you got! Leave a comment below or contact me. I’d love to hear your ideas.
Rock on.