uCosminexus Application Server, EJB Container Functionality Guide
![[Contents]](FIGURE/CONTENT.GIF)
![[Glossary]](FIGURE/GLOSS.GIF)
![[Index]](FIGURE/INDEX.GIF)
![[Back]](FIGURE/FRONT.GIF)
3.5.3 Precautions during the implementation of a transaction in the EJB client application
The precautions to be taken when implementing a transaction in an EJB client are indicated below:
- If an exception occurs during the initialization processing of a service, the system property might not be specified properly. You follow the exception message in such a case.
- If the mandatory, required, and supports attributes are specified in the Container-Managed Transaction (CMT), the invoked Enterprise Bean can be executed within the scope of the transaction started in the EJB client application.
- If an EJB client application shuts down because of a failure during the transaction processing, you need to restart the EJB client application and execute the recovery process of the global transaction. Design the EJB client application in such a way so that after restarting the EJB client application, the initialize method of the EJBClientInitializer class is invoked and the recovery process of the global transaction starts. Transaction is recovered in the background, therefore, initialize method does not wait until completion of recovery and returns.
- If the transaction is started in an EJB client application, design the EJB client application so that its process always stops after all the transactions are completed. If you stop the processing of the EJB client application without waiting for the transactions to conclude, the transactions in the Preparing status might be remained without being concluded. In such a state, you cannot perform the normal termination of Application Server and the resource adapter. Furthermore, the resource lock might not be released.
For any reason if a transaction that is in the Preparing state remains back, you must restart the EJB client application and execute the recovery process of the global transaction.
- In an EJB client application, the root application information and client application information are not included in the performance analysis trace that JTA and OTS output. To trace a request, use a hash code of the thread and XID information. The message output when a transaction timeout occurs includes the hash code of the thread that starts the transaction instead of including the root application information.
All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd.