Deleting from the Repository

Note: This tip contains descriptions of deletions from both versions of VisualAge for Java. Make sure you follow the directions for your version of the tool!

One of the most glaring omissions from version 1.0 of this great tool is that you cannot easily delete from the repository.  Here's the only way I know of that you can clean things up!

The following procedure shrunk my repository from 36MB to 18MB! That's gotta help performance somewhere!

What is in the repository?

In the repository you have

What do you need to keep?

You need to keep:

Deletion Procedures

The deletion procedure varies for version 1.x and 2.x of VisualAge for Java.   Follow the section appropriate to the version of the tool that you are using.

Deletion Procedure, VisualAge for Java Version 2.x

Note: If you are running version 1.x of VisualAge for Java, see Deletion Procedure, VisualAge for Java Version 1.x.  You cannot use the 2.x procedure for version 1.x.

V2.0 has three respository functions called "purge", "restore" and "compact."

"Purge" marks projects, packages, classes/interfaces and methods as "garbage".  If you decide to get them back, you can "restore" these marked objects.  They still exist in the repository.  You cannot purge versions of objects that are referenced in your workspace.

"Compact" removes all purged items from the repository.  They CANNOT be recovered.  Note that you cannot compact unless _all_ objects in your workspace have been versioned.  "Compact" also gets rid of "open" editions of methods.  These are all those timestamped versions of methods that you can replace while working on methods.

There's a trick with "purge", though.

If you purge a project, you ONLY purge the project object from the repository.  It _does_not_ affect any of the packages, class/interfaces or methods referenced in that project.

If you purge a _package_, all versions of objects referenced in that package are purged (as long as those versions aren't used somewhere else, like in a different version of the package.)

Deletion Procedure, 2.x

If you want to get rid of excess baggage in the repository, I recommend the following actions:

  1. add everything you want to keep to your workspace (this makes sure you don't accidently purge something you wanted, as its in the orkspace and VAJ won't let you purge it.)
  2. make sure everything in your workspace is versioned
  3. bring up repository explorer
  4. purge versions of projects you don't want any more (purge is on the popup menu for packages and projects in the repos explorer)
  5. purge versions of packages you don't want any more
  6. compact the repository (Admin->Compact repository)1

The compact may give you time to get that Columbian coffee DIRECT, so give it some time...

If you are running version 2.x STOP HERE!  DO NOT follow any of the following text!

Deletion Procedure, VisualAge for Java Version 1.x

Note: If you are running version 2.x of VisualAge for Java, see Deletion Procedure, VisualAge for Java Version 2.xDo not use the 1.x procedure for version 2.x!!!!!!!!!!!!!!


The stuff you export in interchange file ONLY KEEPS THE LATEST VERSION! If you think you'll ever need older versions of your source, either DO NOT do this cleanup, or make sure you keep the ivj.dat.old file around somewhere safe.

Deletion Procedure, 1.x

WARNING: I cannot take responsibility is this procedure does not work for you!   Make sure you back up your repository file (\IBMVJava\ide\repository\ivj.dat) before doing this!

To clean things up:

  1. Back up your repository (mentioned above) to some place safe.
  2. Make sure all of your projects in the workspace are versioned
  3. Make sure all projects (except the "wrong" JDK) that you want to keep are in your workspace. Add them from the repository if you want.  (Just don't add whatever JDK they list -- It'll be either Sun Class Libraries PM (for OS/2) or Sun Class Libraries Win32 (for Windows))
  4. Make sure any projects you don't want are deleted from the workspace.
  5. Export all the JDK, BDK and IBM samples to some samples.dat file using Interchange format. This is just to keep them around if you want to use them someday. I kept all mine in the \IBMVJava\ide\repository dir. After this export is complete, delete these projects from your workspace.
  6. Export all the things you want to keep to a core.dat interchange file. Again, I stuck mine in the repository dir
  7. Make sure that the only things in your workspace are the things you exported to the core.dat file.  And do not edit or even touch any files in the workspace until the repository switch is over.  Otherwise you run the risk of getting consistency problems between the workspace and repository, which sometimes causes a few things to act funky.
  8. Exit VisualAge for Java
  9. Go into the \IBMVJava\ide\repository dir
  10. Rename ivj.dat ivj.dat.old to play it safe...
  11. Rename core.dat to ivj.dat

And you're done!  Go into VisualAge and you'll only see the stuff that was in core.dat!

Further Deletions for version 1.x

Now that you have a clean repository and workspace, save a coy of each.

  1. Copy \IBMVJava\ide\repository\ivj.dat to base.dat.
  2. Copy \IBMVJava\ide\program\ide.icx to base.icx.

Further cleanups can follow this simpler procedure:

  1. Rename your repository (\IBMVJava\ide\repository\ivj.dat) file to all.dat.
  2. Copy your saved base.dat file to \IBMVJava\ide\repository\ivj.dat.
  3. Copy your saved base.icx file to \IBMVJava\ide\program\ide.icx. This will replace your workspace with the saved workspace (which corresponds to the saved repository.)
  4. Start VisualAge for Java.
  5. Import the code you want to keep from all.dat. Remember that repository files are interchange files, so you can do this by selecting "Interchange File" as the import format. You can select any projects or packages to import from the all.dat file, as well as which versions of those projects and packages to keep.
  6. Add the projects and packages to your workspace from the repository.

This procedure allows you to easily save multiple versions of code in your repository while removing those that you dont want to keep.

I know it's a bit of a pain to do this, but right now it's the only way to get garbage out of the repository.