Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Ask the Experts: Dan Wolfson on DB2 and WebSphere MQ Integration

Dan Wolfson, Senior Technical Staff Member, IBM, Software Group
Dan Wolfson is a Senior Technical Staff Member and manager of the IBM Database Technology Institute for e-Business. With more than 15 years of experience in distributed computing, Dan's interests have ranged broadly across databases, messaging, and transaction systems. Dan is currently the lead architect for information integration.

Summary:  Dan Wolfson answers questions from readers about using WebSphere MQ functions in DB2, such as availability on z/OS, when to use two-phase commit on z/OS, what type of help is available when parsing the message, and message size limitations, among other things.

Date:  01 Oct 2002
Level:  Introductory

Activity:  4864 views
Comments:  

© 2002 International Business Machines Corporation. All rights reserved.

Dan Wolfson's previous articles for the DB2® Developer Domain, Using MQSeries® from DB2 Applications, and DB2 MQ XML Functions: Using MQSeries and XML Extender from DB2 Applications, have generated a lot of response from our readers. Here are some of the questions Dan has received:

DB2DD Reader: Is there any message size limitation when messages are sent to MQSeries (WebSphere® MQ) via the DB2 interface? Currently, when messages are sent via the CICS® interface, one is limited to the 32K ceiling of the COMMAREA. This gives us a segmentation problem - and this may solve it.

Dan Wolfson: The first set of functions we delivered supported a 4000-byte maximum message size. However there is an additional, newer set of functions that support 1MB CLOBs. Information about these functions can be found in the release notes for DB2 UDB V7 Fixpack 4. The XML MQSeries functions have also been extended to support CLOB values. For details, see the release notes for DB2 XML Extender Fixpack 4.

DB2DD Reader: Do the MQ Series extensions that enable WebSphere MQ (MQSeries) messaging to integrate with database applications apply to DB2 for OS/390® and z/OSTM?

Dan Wolfson: When I initially wrote that article, the functions (like MQSEND, MQRECEIVE, MQPUBLISH, MQSUBSCRIBE, and so on) were available only on DB2 Version 7.2 of Windows®, AIX®, Solaris®, and HP/UX®. They are of course also available on those platforms in V8. I'm happy to report that several of the functions have been ported to DB2 on z/OS and OS/390 Version 7, including MQREAD, MQREADCLOB, MQRECEIVE, MQRECEIVECLOB, MQSEND, MQREADALL, MQREADALLCOB, MQRECEIVEALL, MQRECEIVEALLCLOB. Notice that the CLOB functions, which provide the capability to have message sizes larger than 4000 bytes, are also available on this platform. These functions are available with PTF UQ71197 and the DB2 for OS/390 manuals are updated, specifically the V7 Application Programming and SQL Guide, SQL Reference, and Installation Guide.

The 390 implementation also supports transactional integration (because of the RRS support on that platform). The first release for 390 will not include all of the XML integration features since we are trying to get the base functions out as quickly as we can. We plan to follow the first shipment with a second delivery covering the functions related to XML Extender, and the other pub/sub functions as quickly as we can.

DB2DD Reader: When would I use one-phase commit as opposed to two-phase commit?

Dan Wolfson: Currently, MQSeries functions support two-phase commit only on DB2 Universal Database for OS/390 and z/OS. For DB2 for OS/390 or x/OS, there are UDF versions that support one-phase commit and two-phase commit. Here are some issues you might want to consider when choosing one or the other:

MQSeries functions that support single-phase commit: When your application uses single-phase commit, DB2 COMMIT or ROLLBACK operations are independent of MQSeries operations. If a DB2 transaction is rolled back, the messages that have been sent to a queue within the current unit of work are not discarded. This scenario is useful in the case of application error. You might want to use MQSeries messaging to notify a system programmer that an application error has occurred. The application issues a ROLLBACK after the error occurs to roll back the DB2 work, but the message is still delivered to the queue that contains the error messages.

MQSeries function that support two-phase commit: If your application uses two-phase commit, RRS controls the commit process. If a DB2 transaction is rolled back, the messages that have been sent to a queue within the current unit of work are discarded. For example, assume that a sales transaction that is recorded in a DB2 database causes an MQSeries message to be sent to a queue. The message in turn causes your inventory system to order replacement merchandise. That message should be discarded if the transaction representing the sale is rolled back. In the two-phase commit environment, if you want to force MQSeries messages to be added to or deleted from the message queue, you need to issue a COMMIT in your DB2 application program.

DB2DD Reader: Why would I use these functions as opposed to writing my own MQ application?

Dan Wolfson: I think the primary reason is that you can easily combine queueing and database operations in the same SQL statement. So you can use a single simple SQL statement to publish the contents of a column or table as a message (select mqsend(lastname) from employee) or insert the contents of a queue into a table (insert into t values (select * from table (mqreceiveall()) t) ). You can embed messaging statements in triggers..etc. In addition, client applications can utilize this functionality without needing MQ on their machines; MQ only needs to be installed at the DB2 server.

Also, obviously, there's the ease of system integration effort and the performance enhancement you can achieve when MQ UDFs are used vs. writing your own MQ applications. The interface to MQ UDFs is simple to understand and configure, and the use of available UDFs whenever possible is a common practice.

DB2DD Reader: What is involved in setting up the AMI configuations?

Dan Wolfson: This generally includes setting up the enviornment variable AMT_DATA_PATH, the AMI host file amthost.xml, as well as the repository file amt.xml. The MQ UDF's enable utility program shipped with DB2 UDB (enable_MQFunctions) will perform a default configuration for you once you have the AMT_DATA_PATH set up to indicate where you want the host file and repository file kept in your AMI configurations. You can also customize your own configuration once you have a better understanding of how AMI works.

For DB2 z/OS or OS/390, you need to copy and customize the DSNAMT and DSNAMTHT files which are located in prefix.SDSNSAMP.

DB2DD Reader: What is available to help with parsing the message?

Dan Wolfson: For DB2 on distributed platforms, we have a set of MQ UDFs and UDB Stored Procedures (SPs) shipped as part of the DB2 XML Extender that handles XML type messages. These SPs provide support to parse XML messages in the queue and store the elements' values to a set of predefined DB2 tables. (The reverse operation that constructs XML messages from tables is also availble.) The mapping is based on the DAD file that is provided as input parameter to the SPs. Please refer to the the XML extender documentation for more detailed information.

There is also support in the Development Center to generate table functions that automatically parse positionally defined or delimited messages.

DB2DD Reader: Can we use the basic DB2 and Websphere MQ Integration to pass an SQL update statement to DB2 from MQ, or do we need MQSI to do this?

Dan Wolfson: You need MQSI to do this. There is some additional functionality planned that will simplify this interaction, but for the moment you would either have to use MQSI or write your own application.


About the author

Dan Wolfson is a Senior Technical Staff Member and manager of the IBM Database Technology Institute for e-Business. With more than 15 years of experience in distributed computing, Dan's interests have ranged broadly across databases, messaging, and transaction systems. Dan is currently the lead architect for information integration.

Report abuse help

Report abuse

Thank you. This entry has been flagged for moderator attention.


Report abuse help

Report abuse

Report abuse submission failed. Please try again later.


developerWorks: Sign in


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

Choose your display name

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


Rate this article

Comments

Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Information Management
ArticleID=14387
ArticleTitle=Ask the Experts: Dan Wolfson on DB2 and WebSphere MQ Integration
publish-date=10012002
author1-email=
author1-email-cc=

Table of contents

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

For articles in technology zones (such as Java technology, Linux, Open source, XML), Popular tags shows the top tags for all technology zones. For articles in product zones (such as Info Mgmt, Rational, WebSphere), Popular tags shows the top tags for just that product zone.

For articles in technology zones (such as Java technology, Linux, Open source, XML), My tags shows your tags for all technology zones. For articles in product zones (such as Info Mgmt, Rational, WebSphere), My tags shows your tags for just that product zone.

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Try IBM PureSystems. No charge.

Special offers