uCosminexus Application Server, EJB Container Functionality Guide

[Contents][Glossary][Index][Back][Next]

4.3.5 Precautions during the implementation of a Message-driven Bean

This subsection describes the precautions to be taken when implementing a Message-driven Bean.

Organization of this subsection
(1) Precautions when setting up a transaction of the Message-driven Bean (When using a resource adapter conforming to Connector 1.0)
(2) Notes when setting a transaction of Message-Driven Bean (when using a resource adapter conforming to Connector 1.5)

(1) Precautions when setting up a transaction of the Message-driven Bean (When using a resource adapter conforming to Connector 1.0)

When the delivery of messages to the Message-driven Bean, and database access in the Message-driven Bean are executed synchronously, set up the transaction setting of the Message-driven Bean to Required in CMT. By doing this, if the transaction rolls back, the messages will be re-delivered to the Message-driven Bean. However, because the re-delivery of messages will also be iterated when the transaction rollback iterates, you must check the re-delivery of messages using the getJMSRedelivered method of the javax.jms.Message class in the Message-driven Bean. If NotSupported is specified in CMT or if a message is received once by the Message-driven Bean in BMT, the message will not be re-delivered even if the transaction rolls back.

(2) Notes when setting a transaction of Message-Driven Bean (when using a resource adapter conforming to Connector 1.5)

When you use a global transaction for the resource access processing in OpenTP1, which uses the TP1 inbound integration functionality, and the Message-driven Bean, select CMT as the method for managing the Message-driven Bean transactions. Also, set the transaction attribute to Required.

Even when you use a global transaction in EIS that delivers messages to other Message-driven Beans and in resource access processing within the Message-driven Bean, select CMT as the method for managing the Message-driven Bean transactions. Also, set the transaction attribute to Required.

However, when you use the CJMSP resource adapter or the FTP inbound adapter, the delivery of messages to a Message-driven Bean and the resource access processing in the Message-driven Bean cannot be executed concurrently by using the global transaction. Therefore, to receive messages from the CJMSP resource adapter or the FTP inbound adapter, set BMT or CMT as the method for managing the Message-driven Bean transactions, and set the transaction attribute to NotSupported.