Please review the attached patch which contains a number of bug fixes in addition to modifications intended to restructure the code to support a generalized backend datastore. I have developed a copy of GNATS (which I'm calling gnats-dbi) which utilizes a backend datastore api and can be configured with either a flat-file or Oracle backend. Anyone interested can download a copy from http://professional.juniper.net/gnats/. This patch is the first of many I plan to submit to merge my changes back into the official GNATS project and thereby enhance it with the ability to have multiple backends. This first patch is rather large. Hopefully, most of the subsequent ones will be easier to digest. The primary goal in this patch was to begin isolating the index logic from the PR edit functionality. A number of performance improvements have been made in the process. Note that I started developing and testing primarily on my Mac and this exposed a few memory related issues which I decided to fix in the process. -- Mel Hatzis