SDK - MDProvider new transientCreateAction and transientOpenAction to change the model with multiple MetaData Services installed.

Technote (FAQ)


Question

How can I have multiple MetaData Services active and still be able to manage / publish the model with the FM SDK ?

Cause

Multi Dispatcher systems with Multiple MetaData Services enabled cause errors with FM SDK / SDK Action Statements.

Answer

The MDProvider in the FM SDK package works with the MetaDataService in a Synchronous Conversation operation, this is much unlike all other services in IBM Cognos.

New Transient Actions were added to the MDProvider as of IBMC8.4.1 Fixpack 5 Release.

Purpose
There will be a MetaData Service problem with multiple dispatcher systems when running the Service via the SDK API Toolkits.
Here is the explanation of the problem :

By using the MDProvider from the FM SDK API to execute a sequence of commands, this is usually done within three steps :

* open (or create) a model
* execute the actions
* save and / or close the model.

Each step is done in the early versions was a separate "updateMetadata" call.

The problem is that in Multi Dispatcher environments the dispatcher used for the SDK code, does not ensure that the consecutive "updateMetadata" calls will be executed on the same dispatcher / service , which will cause the "execute", "save" and "close" actions to fail because the model is opened or created on a different machine or Service. The current service is unaware where the model exist, and if it was opened or closed.
The error message that is received will say : "BME-AS-0022 Model was not opened"

The problem might not appear with short action requests, which will be executed in a short period time.
But it is certain that for longer transactions, or the ones that takes more time to open the model and execute, this error message will appear, and the SDK Code becomes not usable.

Because there are also status fields on the Dispatcher for the Synchronous MetaData Service , to clear this error - the dispatcher and its services need to be recycled or restarted. Such is required for Synchronous Communication.

MetaData Service errors have also be seen affecting the Model itself since it was open , and this will be evident if you try to access it with Framework Manager.
It is very likely that a Model can become corrupted in this manner.
Ensure that you always have a backup of the model available !

New MDProvider Transient Actions
To resolve these problems , two new MDProvider transient actions have been created :

* transientCreateAction
* transientOpenAction

Each Transient Action opens ( or creates ) the model, execute the actions in One MDProvider transaction statement , and then saves and closes the model in one "updateMetadata" call.
Big action logs can be split in smaller pieces , and can then execute with separate calls to "transientCreateAction" and "transientOpenAction".

Format
The Transient Actions need to have a path on the file system where it can create / open and close / save the model file , otherwise the actions will fail.

The requests for both Transient Actions would look like :


<mdprovider type="transientCreateAction" action="execute" model="c:/temp/myproject/myproject.cpf">
<transaction seq="1">
<action seq=\"1\" type=\"SetDefaultLocale\">
<inputparams>
<param seq=\"1\" type=\"i18nstring\">
<value>en</value>
</param>
</inputparams>
<domchanges/>
<result success=\"t\">
<outputparams/>
</result>
</action>
<action seq=\"2\" type=\"SetActiveLocale\">
<inputparams>
<param seq=\"2\" type=\"i18nstring\">
<value>en</value>
</param>
</inputparams>
<domchanges/>
<result success=\"t\">
<outputparams/>
</result>
</action>
. . .
. . .
</transaction>
</mdprovider>


<mdprovider type="transientOpenAction" action="execute" model="c:/temp/myproject/myproject.cpf">
<transaction seq="1">
<action seq=\"1\" type=\"SetDefaultLocale\">
<inputparams>
<param seq=\"1\" type=\"i18nstring\">
<value>en</value>
</param>
</inputparams>
<domchanges/>
<result success=\"t\">
<outputparams/>
</result>
</action>
<action seq=\"2\" type=\"SetActiveLocale\">
<inputparams>
<param seq=\"2\" type=\"i18nstring\">
<value>en</value>
</param>
</inputparams>
<domchanges/>
<result success=\"t\">
<outputparams/>
</result>
</action>
. . .
. . .
</transaction>
</mdprovider>


The action transientCreateAction will include the complete actions of :

* Create a project c:/temp/myproject/myproject.cpf (or other file location)
* Execute the provided actions
* Save the project
* Close the project


The action transientOpenAction will include the complete actions of :

* Open a project c:/temp/myproject/myproject.cpf (or other file location)
* Execute the provided actions
* Save the project
* Close the project

Important to note this is that both of these actions include the Saving and Closing of the Project and Model.

Big action logs can be split to smaller pieces for convenience. When splitting the action log files into pieces you have to

- Combine the actions in one transaction per piece
- Copy the actions that set the default and active locale from the beginning of the original action log to the beginning of each piece of action. This is important and failing to do so will cause errors in running the SDK code.

Drawbacks

- Each transientOpenAction command will open and save the project every time is called.
This means that the transactions should be big enough to minimize the number of opening and saving the project.

Note: When splitting big action logs be careful to ensure that the split point is at a "safe place".
For example you do not want to split the action log just before an "undo" operation. Failing to do so will lead to an error during the execution.

Other Important Information :

On Multi-Systems installations , All Dispatchers need to have access to the same Model File in the File system, and this location must then be a UNC Shared Directory , for all these Dispatchers handling the MetaData Service requests in the SDK Code.
In Linux / Unix the NFS file system should be used for common locations of the model.

Programming Information :

When multiple Authors are using the same application code for model updates , some form of "locking" and checking for "locks" of the Model Files in the file system needs to be implemented in the SDK Code when these actions are performed.

Basically any other Action process needs to be "locked out" until the previous "update" process is complete.
It is strongly recommended to limit the amount of users who have access, or have capability to modify and publish models via the FM SDK API, to only a few in your organisation.
Assigning this work to many, it is found that FM modelling becomes un-manageable and is causing errors , issues , problems and consequences of actions.

Model Versioning should be turned off when testing is being done via the SDK , so that the Action scripts can be evaluated on their proper working.
See the technote below.
When Model Versioning is turned on , certain errors could come up that have little to do with the actual SDK running of code.

Related information

TN 1609635 - Disable model versioning on a MDProvider p


Cross reference information
Segment Product Component Platform Version Edition
Business Analytics Cognos Business Intelligence Framework Manager Windows 10.2.2, 10.2.1, 10.2, 10.1.1, 10.1, 8.4.1 Edition Independent

Document information


More support for:

Cognos Business Intelligence
Software Development Kit

Software version:

8.4.1, 10.1, 10.1.1, 10.2, 10.2.1, 10.2.2

Operating system(s):

AIX, HP-UX, Linux, Solaris, Windows

Software edition:

Edition Independent

Reference #:

1641460

Modified date:

2015-11-16

Translate my page

Content navigation