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 operation, unlike all other services in IBM Cognos.

New transient actions in MDProvider as of IBMC8.4.1 Fixpack 5 Release.

Purpose
There is an MetaData Service problem with multiple dispatcher systems.
Here is the explanation of the problem :

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

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

Each step is done in 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 server, which will cause the "execute", "save" and "close" actions to fail because the model is opened or created on a different machine / Services.
The error message will say "The model is not opened . . .".

The problem might not appear with short transactions which will be executed in less time, but it is for sure that for long transactions or the ones that takes more time to open the model or execute it will appear.

Because there are status fields on the Dispatcher for the MetaData Service, to clear this error the dispatcher and its services need to be recycled.
MetaData Services errors have also be seen affecting the Model itself, and this will be evident if you try to open it with Framework Manager.
Ensure that you always have a backup of the model available !

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

* transientCreateAction
* transientOpenAction

Each action open (create) the model, execute the actions in One MDProvider transaction, and close (save) the model in one "updateMetadata" call.
Big action logs can be split in smaller pieces then and 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 it will fail.

The requests for both 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

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 the each piece. 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.

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 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 SDK, to only a few in your organisation.
Assigning this work to many, it is found that 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.
When turned on, certain errors can come up that have very little to do with the SDK running of code.


Related information

TN 1609635 - Disable model versioning on a MDProvider p
TN1335762 - Create Model set default Locale and publish

Rate this page:

(0 users)Average rating

Add comments

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

Operating system(s):

AIX, HP-UX, Linux, Solaris, Windows

Software edition:

Edition Independent

Reference #:

1641460

Modified date:

2013-09-23

Translate my page

Machine Translation

Content navigation