Thursday, June 23, 2011

How to remove unused files/artifacts from MDS?

          In development phase of project, we will be adding different artifacts to the MDS so that can be accessed by different processes. In course of development /design changes, applying best practices, there is bound to be lot of unused folders /artifacts lying around in the MDS store. So it is always advised to remove the unwanted artifacts, test the processes before we export them to other environments. I always used a workaround to remove the files, even though it was not the best approach.

 There is a table called MDS_PATHS where there would be entries corresponding to each artifact. I used to delete the entries from the table and the artifacts never used to show up, even though there will be entries in other related tables.

The best approach/solution is to use WLST command for cleaning up the MDS store. There is a function called deleteMetadata in WLST which will do the job for you.
This is how Oracle documentation describes the command. It deletes the selected documents from the application repository. When this command is run against repositories that support versioning, that is a database-based repository, delete is logical and marks the tip version (the latest version) of the selected documents as "deleted" in the MDS repository partition.
For more attributes and options available with the command refer this doc

The WLST script is located at:

(Windows) MIDDLEWARE_HOME\Oracle_SOA1\common\bin\wlst.cmd

Once the scripting tool is initialized, Connect to the server

offline>connect(‘username,’pwd’, ‘hostname:7001’)

For running deleteMetada function you need a minimum of 3 inputs
-          application  - since we are deleting from shared artifacts of soa-infra, the value should be soa-infra
-          server -  value should be ‘soa_server1’ or the server u use for SOA other than admin server.
-          docs – the folder path or artifact which you want to delete.

wls:/GEO_domain/serverConfig> deleteMetadata(application='soa-infra',server='soa

Executing operation: deleteMetadata.

Operation "deleteMetadata" completed. Summary of "deleteMetadata" operation is:

List of documents successfully deleted:

1 documents successfully deleted.

This will be really useful in all projects as cleanup in mandatory in the MDS. Thanks to jithendra and Ram for their inputs.

Monday, June 13, 2011

File sorting while processing using File/FTP adapter

File Adapter can process files in parallel if there are multiple threads. In case you want a particular order in which the files need to be processes then you must follow guidelines here

For writing custom file sorting algorithms follow the below blog.

Tuesday, June 7, 2011

Avoiding invalid composites at server startup -Abstract V/s Concrete WSDL

One year back I got a chance to help a team working on AIA PIP migration project, the team was stuck with compilation issues of processes that gets migrated to 11g. All processes were using concrete WSDL of dependent processes which were not even ready. That’s when as a best practice we replaced all concrete WSDL’s with Abstract WSDL. Similar issue happens during startup of the server. While loading processes from MDS, there used to be issues related services being unavailable due to the order of process loading. That’s when much emphasis was laid on using Abstract WSDL compared to Concrete WSDL .A nice article on why Abstract WSDL need to be used instead of using concrete WSDL during design time and how it works @ runtime.