none
Caching of Initialisation Method Data RRS feed

  • Question

  • I've noticed that when you run preview full syncs from the FIM GUI it doesn't run the initialisation() method every time. I don't know what the exact behaviour is but it definitely does some kind of caching of variables set in the initialisation method. I guess that wouldn't be a problem if you're not calling to an external system inside the initialisation method (I'd never do that ... ). This can make testing annoying where you have to run a full sync to get it to run the initialisation method again. You can also restart the service to force it to run the init method again. Has anyone encountered something similiar?
    • Edited by Dan_Walters Friday, August 16, 2013 4:02 AM
    Friday, August 16, 2013 3:44 AM

Answers

  • Doesn't explicitly mention initialize. I haven't noticed any change in this since MIIS.

    http://technet.microsoft.com/en-us/library/cc720667(v=ws.10).aspx

    Using the Metaverse Rules Extension Initialize and Terminate Methods

    Your rules extension .dll contains an Initialize method, which you can use to include code for any preprocessing work that the rules extensions in the .dll might require. For example, you might place code here to read an XML file that contains constants for the rule extensions or make a connection to a database. MIIS 2003 only loads the .dll when it determines that a call will be made to a rules extension in the .dll. After loading the .dll, MIIS 2003 calls Initialize prior to making the first call to the rules extension.

    The rules extension .dll also contains a Terminate method, in which you can include code for cleanly releasing resources before the .dll is unloaded. For example, if you connected to a database in the Initialize method, yourTerminate code would close this connection. As with management agent rules extensions, although the current version of MIIS 2003 calls Terminate when no rules extension is called within a 5-minute interval, you should not build your rules assuming that this will be the case in the future.

    • Marked as answer by Dan_Walters Saturday, August 17, 2013 1:30 AM
    Friday, August 16, 2013 11:48 AM

All replies

  • Yes it will keep it cached for 5 minutes (unless something else runs), then run the terminate() method and unload the DLL.

    Friday, August 16, 2013 8:30 AM
  • Thanks for answering. How do you know that? Is it mentioned in any documentation?

    Friday, August 16, 2013 11:33 AM
  • Doesn't explicitly mention initialize. I haven't noticed any change in this since MIIS.

    http://technet.microsoft.com/en-us/library/cc720667(v=ws.10).aspx

    Using the Metaverse Rules Extension Initialize and Terminate Methods

    Your rules extension .dll contains an Initialize method, which you can use to include code for any preprocessing work that the rules extensions in the .dll might require. For example, you might place code here to read an XML file that contains constants for the rule extensions or make a connection to a database. MIIS 2003 only loads the .dll when it determines that a call will be made to a rules extension in the .dll. After loading the .dll, MIIS 2003 calls Initialize prior to making the first call to the rules extension.

    The rules extension .dll also contains a Terminate method, in which you can include code for cleanly releasing resources before the .dll is unloaded. For example, if you connected to a database in the Initialize method, yourTerminate code would close this connection. As with management agent rules extensions, although the current version of MIIS 2003 calls Terminate when no rules extension is called within a 5-minute interval, you should not build your rules assuming that this will be the case in the future.

    • Marked as answer by Dan_Walters Saturday, August 17, 2013 1:30 AM
    Friday, August 16, 2013 11:48 AM
  • Thankyou! This is great to know for testing when you need to change a configuration file between tests that is read in during the initialize method.
    Saturday, August 17, 2013 1:30 AM