Some questions about using SQL Server for lookup in a rules extension?

Also, another, somewhat related question:

I know that rules extensions and the metaverse extension are DLLs after they're built/compiled, but do the DLLs get instantiated and initialized each time they get invoked by ILM?  Or, are they instantiated and initialized only once, e.g., at ILM startup?

July 11th, 2013 10:54am

Hi,

Somewhat related to my question, I've found this older thread:

http://social.technet.microsoft.com/Forums/en-US/aff84420-6ddc-41c6-86e4-a986ddeedf04/miis-2003initialize-function-in-extensionhow-it-work

that says that, for the MVExtension (DLL), the Terminate() method gets called after 10 minutes of inactivity, and the MVExtension gets "unloaded" (the "Provisioning" Word document says 5 minute).

That thread seems to also indicate that MA rules extensions would work the same way, but I'm somewhat unclear about what "inactivity" means in terms of (1) the MVExtension and (2) a rules extension?

The reason for this question is that I was thinking that one way we could "persist" the SQL server connection from the rules extension is to put the code that instantiates the SQL server connection into the rules extension's Initialize() method, but that would only be viable/work if the rules extensions Terminate() method doesn't get called everytime the methods that we use in the rules extension are called?

Thanks,

Jim

Free Windows Admin Tool Kit Click here and download it now
July 11th, 2013 12:06pm

Hi,

I vaguely remember seeing a whitepaper or maybe one of the walkthroughs for ILM where, within a rules extension, they were using a table in SQL server as a lookup table, e.g., for mapping attributes or something like that.

Does anyone here recall something like that?

The reason for I'm looking for that is that some of our "legacy" extensions are doing something like, where they map a pair of attributes (like location name and state) into postal codes.

The way that the current code does this is to instantiate a new connection to the SQL server each time the extension is invoked, but we've been asked if it'd be possible to not do that, but to do something like create the connection at the beginning of the profile run, and then just use the same connection for the lookups/queries, and I was hoping that walkthrough (or whatever it was) might have some suggestions about how to do that in ILM.

With ILM, is there some way to do something like that, like maybe at start of the profile run (or maybe even at ILM startup) to open a connection to an SQL server and then, within the rules extensions, re-use that already instantiated connection?

Thanks,

Jim

July 11th, 2013 4:34pm

For the record, and answering my own question:  It appears that we can accomplish this by putting global variables in the class (e.g., the connection object), then:

- In Initialize(), establish the connection

- In other methods that need to access the SQL server for lookup, use the connection that was pre-established.

Also, it appears that "inactivity" means basically that no methods in the DLL get called, and if there is inactivity for > 5 minutes, the Terminate() method gets called, and then the DLL gets unloaded (this includes the MVextension).

Free Windows Admin Tool Kit Click here and download it now
July 13th, 2013 5:15am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics