The SSIS Foreach Loop Container, Logging and ERCB.putAmendment Debugging
As it turns out, it was possible to handle GROUND ELEVATION: and SURFACE CO-ORDINATES: type amendments using a slight modification to the logic used to handle SURFACE LOCATION: amendments — which makes sense, because they all ultimately result in a change the base.Point instance to which the well is linked. As previously mentioned, any amendment which involves changing the location of the well requires a recall of the original surface location and offsets. The logic for generating the iSentence XML to capture all of this information was stored in ERCB.getSurfaceCoordinatesXml() function. Also, given these types of amendments involve deleting existing and then adding new instances from/to a variety of tables, BEGIN TRANSACTION...COMMIT TRANSACTION syntax was used to ensure the whole change rolled in. Or didn’t.
That done, an SQL Server Integration Services (SSIS) Foreach Loop Container was used to control the looping of the load logic and process each of the ST1 files. A pretty good primer on the subject can be found on the Microsoft site. Essentially, it’s just a matter of creating the Foreach container itself, and dragging-n-dropping all of the previously-defined steps into the container. Then, a variable is set up to capture the name of the current file being processed and feed it to the connection string. Of course, as groups of ST1s were being loaded, small problems cropped up with ERCB.putAmendment (and related) procedures, but nothing took more than a few minutes to resolve.
In order to monitor the loading of the 2600+ ST1s, logging capability was determined to be important; hence the creation of the base.Log table, and the ERCB.putLog stored procedure to populate it. This was another use for the iSentence XML namespace. As a bi-product of this work, the function base.getNullXml() was created. It’s job is to simply return an iSentence-compliant XML that doesn’t contain anything, other than the namespace declaration, of course. base.putAmt() and base.putTxt() functions were used to add elements to it, and — voila! — you have a parsable log record which ERCB.putLog can put into base.Log.
The statistics above were used to measure the length of time each ST1 takes to load into the Intellog database, over time. That was averaging about a minute per ST1 in the early tests, but it should be monitored as the data rolls in. The view ERCB.WellLicensesIssuedLoad was created, and used to generate an Excel spreadsheet (LoadStatistics.xls) which charts average load time. The output of this application can be seen to the immediate left. So far, the performance is a pretty flat curve, which is good.
Finally, ABtest.kmz has been refreshed with approximately 13,000 unique locations, for wells licensed during the period 2001-01-01 through the end of 2001-10 inclusive. It can be viewed with Google Earth. Its just one, big monolithic file which uses the standard yellow pushpin placemark and the well label. It can still be used to review the quality of the lat/long conversions, and as a general indicator of the progress being made on the load of Alberta data.
Posted on 30th May 2008
Under: Developers' Journal | 1 Comment »