JRuby調査(続)

トランザクション

EJBコンテナ側でのトランザクションは、期待通りに動く。JRuby側でトランザクション制御するには、UserTransactionが使える。

ctx = InitialContext.new
tx = ctx.lookup('UserTransaction')
tx.begin
...
tx.commit

これはJBossの場合。UserTransactionの取得は、APサーバー依存のはず。

EJB側でトランザクションの乗り合わせ設定(REQUIREDとかMANDATORYとかのアレ。正式名称は?)をかけたときの動作は、未検証。