2.7.4 cosminexus.xmlでの定義

Enterprise Beanのトランザクション管理方法の定義は,cosminexus.xmlの<ejb-jar>タグ内に指定します。設定するタグは,設定対象になるEnterprise Beanの種類ごとに異なります。

cosminexus.xmlでのEnterprise Beanのトランザクション管理方法の定義について次の表に示します。

表2-20 cosminexus.xmlでのEnterprise Beanのトランザクション管理方法の定義

項目指定するタグ設定内容
Enterprise Beanでのトランザクション管理方法(BMTまたはCMT)の選択
Session Beanの場合
<session>-<transaction-type>タグ
Message-driven Beanの場合
<message-driven>-<transaction-type>タグ
Bean(BMT)またはContainer(CMT)のどちらを選択するかを指定します。
メソッドに割り当てるトランザクション属性(CMTの場合)
Session Beanの場合またはEntity Beanの場合
<assembly-descriptor>-<container-transaction>-<trans-attribute>
Message-driven Beanの場合
<message-driven>-<container-transaction>-<trans-attribute>
メソッドに割り当てるトランザクション属性を指定します。
注※
BMTを選択した場合,トランザクションの制御は,API(javax.transaction.UserTransactionクラスのメソッドなど)で実行する必要があります。