7.7.2 Using transactions

If you use transactions, you can compile the operations from the creation of a message to the execution of processing as a series of processing. All the operations included in a transaction finish when the client-side application (application that sends the message) commits the transaction.

You can use the JTA transactions with Cosminexus JMS Provider.

A JTA transaction is managed by the transaction management API (JTA) of Application Server. If the operations in the transaction fail, Application Server processes the exception, and the processing in the transaction is retried or rolled back. You can use the BMT or CMT to manage the local transactions. For details on the BMT or CMT-based transaction management, see 2.7 Transaction management in Enterprise Beans in the uCosminexus Application Server EJB Container Functionality Guide.

Note
When you use the JTA transactions with Cosminexus JMS Provider, the container manages the transactions of the JMS session instead of the Beans. Therefore, do not specify true in the value of the argument transacted in the following methods:
  • createSession(boolean transacted, int acknowledgeMode) method
  • createQueueSession(boolean transacted, int acknowledgeMode) method
  • createTopicSession(boolean transacted, int acknowledgeMode) method
If you specify true, the value is ignored and a warning message is displayed.
Note that when you use the EJB applications, do not use the JMS authorization method in a transaction. The container manages the message authorization within the transaction contexts that do not specify the authorization method.
Also, if a large amount of messages are sent in one transaction, the size of the file that manages the information related to message delivery confirmation increases, and the disk capacity might be compressed. To send a large amount of messages, implement a performance test, and estimate the required file size.