Translated message

A translation of this page exists in English.

EAP 6 で EJB の pass-by-reference を行う方法

Solution Verified - Updated -

Issue

  • EAR 1 の EJB A が EAR 2 の EJB B を呼び出しています。呼び出しは機能しますが、シリアル化/デシリアル化が原因でパフォーマンスの問題が発生します。このオーバーヘッドを回避する方法は?

  • JBoss ejb3 サブシステムに以下のオプションを設定しました。しかし、ejb インターフェースと転送オブジェクトをパッケージングする 2 つの ear をテストすると ClassCastException が発生します。JBoss ではクラスローダーが同じである場合に限り pass-by-reference を使用できるのでしょうか?

    <subsystem xmlns="urn:jboss:domain:ejb3:1.3">
        ...
        <in-vm-remote-interface-invocation pass-by-value="false"/>
    </subsystem>
    

    以下に示すように、EJB 呼び出しにて渡された List からオブジェクトを読み込もうとすると ClassCastException が発生します。

    public TransferReturnValue hellos ( List<TransferParameter> params )
    {
     for(TransferParameter param : params) { // ここで ClassCastException が投げられる
       log.info("received param:" + param.getValue());
     }
     return new TransferReturnValue ( "Hello " + params );
    }
    
  • JBoss のデフォルトのメカニズムは pass-by-referencepass-by-value のどちらを使用していますか?

  • どのようなシナリオで pass-by-reference を使用すべきでしょうか?

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content