This subsection describes the notes on application development when you start a transaction with an EJB client application. For details on implementing transactions with the EJB client applications, see 3.5 Implementing transactions with the EJB client applications in the uCosminexus Application Server EJB Container Functionality Guide.
- To use a global transaction with an EJB client application, immediately after starting the EJB client application, you must invoke the processing for initializing the services to be used with the EJB client application, from the user program. By invoking this initialization processing, the transaction manager and transaction service are initialized. As the initialization processing, invoke the initialize() method of the EJBClientInitializer class.
- By invoking service initialization from the user program even when the EJB client application terminates abnormally during the transaction processing, you can start the transaction recovery. Note that the recovery processing is executed in the background, so the initialize() method is returned without waiting for the recovery processing to finish. Design the EJB client application so that the recovery of a global transaction starts by restarting the EJB client application.
- If transactions are started in an EJB client application, specify the design so that all the transactions are concluded and then the EJB client application stops. If the EJB client application stops without waiting for the transactions to conclude, the unconcluded transactions might remain in the transaction. In this state, you might not be able to terminate Application Server normally, stop the resource adapter, or release the resource lock.