3 Replies Latest reply on Jun 27, 2006 7:44 AM by javaneze

    Remote / LocalHome Interface issue - How smart is JBoss?

      Hi this is my case...and I am trying to see how Jboss handles the situation!

      1.Context -> J2EE 2.1
      2. I have several Stateless Sessioon EJBs that are being marked and declared with remote type (Remote Interface only), At the same time I do not provide any LocalHome Interface
      3. Of course every time I do lookup. for the interface I use lookup.narrow

      Everything seems to be normal I guess!

      The critical question is..on these EJBs that are being invoked all together within the same JVM (could be a typical LocalHome story in other words). JBoss does any RMI call, marshaling and call by value invocations or is he very very smart and despite my only remote definitions invokes methods on these EJBs as they were ..having LocalHome interface and ..passing parameters by reference!

      Is that possible? I am not blaming Jboss I just want to clarify this use case , and my findings at the moment show that there is some sort of network call - rmi.

      Thank you for your time, and any tips are most welcomed!

      A.P

        • 1. Re: Remote / LocalHome Interface issue - How smart is JBoss?
          peterj

          This is not a definitive answer since I have not looked at the JBoss code for this, but in my testing I have found that whether I am using LocalHome or RemoteHome to access EJBs on the same server that the performance is that same, so my guess is that JBoss does perform "magic" under the covers. Also, I vaguely recall someone from JBoss mentioning that this was the case.

          • 2. Re: Remote / LocalHome Interface issue - How smart is JBoss?

            Thanks for your reply...I going through looking at the stactraces...probably..you are right ..there is no big difference..but it is worth taking a look!

            • 3. Re: Remote / LocalHome Interface issue - How smart is JBoss?

              ??! eventually indeed JBoss does the magic! No RMI calls event if all the EJBS are declared only with Remote Interface!
              Though ok I have to say that probably there is some kind of difference when it comes to CPU cycles on perfoming or not perfoming remote calls!

              Anyway the problem started with an application deployed on JBoss 4.0.0 where it had only -remote- EJBs and perfomed only remote calls and in a similar application in JBoss 4.0.2 where again it had again only remote EJBs but it was perfoming loca calls (we are talking to single VM apps..both).
              So after a tip dropped from a JBoss Developer D.Andreadis we had a look on

              \server\default\conf\jboss-service.xml

              and thembean code="org.jboss.naming.NamingService"
               name="jboss:service=Naming"
               xmbean-dd="resource:xmdesc/NamingService-xmbean.xml">
               <!-- The call by value mode. true if all lookups are unmarshalled using
               the caller's TCL, false if in VM lookups return the value by reference.
               -->
               <attribute name="CallByValue">false</attribute>
              

              see CallByValue

              and the
              \server\default\deploy\ear-deployer.xml
              <!-- EAR deployer, remove if you are not using ear deployments -->
               <mbean code="org.jboss.deployment.EARDeployer"
               name="jboss.j2ee:service=EARDeployer">
               <attribute name="Isolated">false</attribute>
               <!-- A flag indicating if the ear components should have in VM call
               optimization disabled.
               -->
               <attribute name="CallByValue">false</attribute>
              


              see callByValue!

              On JBoss 4.0.0 these settings are set to true so JBoss wont perform any magic at all!
              On Jboss 4.0.2 and on...these are set to false so ..it behaves very clever detacting all the local calls.

              so watch out if you are have not noticed these settings...

              Many thanks!