EJB to EJB Performance in same container

I'm very new to this technology so please excuse me if my question is naive.
Is RMI used between two EJB's that are located within the same container? If so, how significant is the performance overhead to do this?

WebLogic by default only uses RMI (and thus serialization) when calling from
one machine to another. You can force RMI to be used on one machine, but
performance degrades significantly per method invocation (going from direct
invocation to RMI invocation).
Most web containers have to use RMI to talk to EJB containers. What I have
described is a WebLogic-specific optimization that is a big selling point
for them. Of course it is also the cause of the 5.1 classloader headaches,
but they have repeatedly said that those will be fixed for the next release.
Cameron Purdy
"Scott Czadzeck" <[email protected]> wrote in message
news:398f5714$[email protected]..
I'm very new to this technology so please excuse me if my question isnaive.
>
Is RMI used between two EJB's that are located within the same container?If so, how significant is the performance overhead to do this?

Similar Messages

  • Lookup ejb in another application in same container

    Hi,
    The 1012 ejb faq http://www.oracle.com/technology/tech/java/oc4j/1012/collateral/OC4J-EJB-FAQ-101202.pdf states:
    "If you want to access an EJB in another application in the same OC4J container you do not have to use RMIInitialContextFactory and you can make the application that contains your application as the parent of your application from your you are trying to access EJBs from e.g. ..."
    Question: The FAQ implies that the "parent" attribute is NOT necessary to facilitate this situation and RMIInitialContextFactory may be used - is this correct? I have not found any examples that demonstrate how to do this as elsewhere in the Oracle doco they seem to imply that "parent" must be used (but not in 10.1.3). Can anyone please clarify this and/or what works and what doesn't?
    Note: The lookup of remote ejb from another application in same container does work without the parent attribute, its just subsequent calls from a 3rd application or redeploy breaks.
    My problem: I get a ClassCastException when :
    a) lookup remote EJB (in application A) following redeploy of application B
    b) the next invocation of the application A method from client application C
    Thanks for any advice,
    Paul

    Your understanding is correct.
    If you make application a to be the parent application of app b; then app b could access app a without using RMIInitialContext.
    Also you could use RMIInitialContext to obtain the object without using "parent application" approach, example:
    Hashtable env = new Hashtable();
    env.put("java.naming.factory.initial",
    "com.evermind.server.rmi.RMIInitialContextFactory");
    env.put("java.naming.provider.url","ormi://remotehost/bmpapp");
    env.put("java.naming.security.principal","SCOTT");
    env.put("java.naming.security.credentials","TIGER");
    Context context = new InitialContext(env);
    Object homeObject =
    context.lookup("java:comp/env/EmployeeBean");
    For this servlet example, you also need to declare <ejb-ref> elements in the web.xml file:
    <ejb-ref>
    <ejb-ref-name>EmployeeBean</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <home>bmpapp.EmployeeHome</home>
    <remote>bmpapp.Employee</remote>
    </ejb-ref>
    In addition, orion-web.xml, must include a mapping from the logical name EmployeeBean to the actual JNDI name where the EJB is bound, as shown in the following example:
    <ejb-ref-mapping name="EmployeeBean" location="bmpapp/EmployeeBean" />
    Hope this helps,
    -Frances

  • Servlets/JDBC vs. servlets/EJB performance comparison/benchmark

    I have a PHB who believes that EJB has no ___performance___ benefit
    against straightforward servlets/JSP/JDBC. Personally, I believe that
    using EJB is more scalable instead of using servlets/JDBC with
    connection pooling.
    However, I am at a lost on how to prove it. There is all the theory, but
    I would appreciate it if anyone has benchmarks or comparison of
    servlets/JSP/JDBC and servlets/JSP/EJB performance, assuming that they
    were tasked to do the same thing ( e.g. performance the same SQL
    statement, on the same set of tables, etc. ).
    Or some guide on how to setup such a benchmark and prove it internally.
    In other words, the PHB needs numbers, showing performance and
    scalability. In particular, I would like this to be in WLS 6.0.
    Any help appreciated.

    First off, whether you use servlets + JDBC or servlets + EJB, you'll
    most likely spend much of your time in the database.
    I would strongly suggest that you avoid the servlets + JDBC
    architecture. If you want to do straight JDBC code, then it's
    preferable to use a stateless session EJB between the presentation layer
    and the persistence layer.
    So, you should definitely consider an architecture where you have:
    servlets/jsp --> stateless session ejb --> JDBC code
    Your servlet / jsp layer handles presentation.
    The stateless session EJB layer abstracts the persistence layer and
    handles transaction demarcation.
    Modularity is important here. There's no reason that your presentation
    layer should be concerned with your persistence logic. Your application
    might be re-used or later enhanced with an Entity EJB, or JCA Connector,
    or a JMS queue providing the persistence layer.
    Also, you will usually have web or graphic designers who are modifying
    the web pages. Generally, they should not be exposed to transactions
    and jdbc code.
    We optimize the RMI calls so they are just local method calls. The
    stateless session ejb instances are pooled. You won't see much if any
    performance overhead.
    -- Rob
    jms wrote:
    >
    I have a PHB who believes that EJB has no ___performance___ benefit
    against straightforward servlets/JSP/JDBC. Personally, I believe that
    using EJB is more scalable instead of using servlets/JDBC with
    connection pooling.
    However, I am at a lost on how to prove it. There is all the theory, but
    I would appreciate it if anyone has benchmarks or comparison of
    servlets/JSP/JDBC and servlets/JSP/EJB performance, assuming that they
    were tasked to do the same thing ( e.g. performance the same SQL
    statement, on the same set of tables, etc. ).
    Or some guide on how to setup such a benchmark and prove it internally.
    In other words, the PHB needs numbers, showing performance and
    scalability. In particular, I would like this to be in WLS 6.0.
    Any help appreciated.--
    Coming Soon: Building J2EE Applications & BEA WebLogic Server
    by Michael Girdley, Rob Woollen, and Sandra Emerson
    http://learnweblogic.com

  • EJB Performance Test

    How do i test MY EJB performance from a Desktop client or JSP or Servlet, I don't have any testing tools

    Hi ,
    If u don't have any tool as such , then you can try testing your EJBs from more than one macines at least.
    I think, the real performance of any distributed components won't be really tested unless and until they are tested for many requests. This is specificaly true with the EJB transactions for dead-locks.
    If u don't have any tool , then u can write a program that sends many requests in a loop , for JNDI look-ups .
    Hope this helps .
    -amit

  • Same container, different ear files, remote lookup failing!

    I'm having severe problems with my ears! I used to have all my EJBs in one ear file and everything worked hunky dory. Now I have separated out various components into their own ear files as they may be deployed into a separate box and also this eases group development. My problem is that some (most) of the remote lookups don't work. I'm getting a Class cast exception when i use the narrow() method.
    I have tried all the methods I can think of now and I'm getting desperate! Initially when all the beans were in the same ear file I used the coded reference for the lookup. This did not work across separate ear files so I replaces the coded reference in the lookup() method to the JNDI name. Now this works for some lookups but not others. Invariably a client application running in the container in a separate ear will work no problem. However a session bean using the same code as the client can not succeed in referencing another bean.
    I'm baffled here because the lookup itself appears to succeed (if I but a garbage name in the lookup method it returns "name not found"). The error I'm getting is class cast exception! Occasionally though it does work - by that I mean it works for some inter-ear references but not others ie it's not intermittant.
    Can anyone shed some light on the correct/best method to lookup a remote reference to a EJB from an EJB living in a different ear file in the same container?

    Found the problem!
    I was using jdk 1.3.0_02 when I should have been using
    jdk 1.3.1_01
    painful...

  • Problem with same Container for 2 different outputs

    Hi,
    I am using method set_table_for_first_display to display 2 different output with same container depending upon the selection of radio button. but the problem I am facing is when I click BACK button after dispaying second output and executing first output, it is showing prebious output only. is there any method to handle this problem?
    Regards,
    Nilanjana

    Hi,
    On clicking back use leave to screen 0 in the PAI module of the screen.
    Call screen 100.
    PROCESS BEFORE OUTPUT.
    Logic
    PROCESS AFTER INPUT.
    MODULE USER_COMMAND.
    MODULE USER_COMMAND INPUT.
    IF sy-ucomm EQ 'User command defined for BACK button'.
    LEAVE TO SCREEN 0. "Go back to selection screen
    ENDIF.
    END MODULE.
    Have a look at the method FREE of class cl_gui_alv_grid.
    eg:
    CALL METHOD wcl_alvgrid1->free
      EXCEPTIONS
        cntl_error        = 1
        cntl_system_error = 2
        OTHERS            = 3.
    Thanks,
    Vinod.

  • JMS message from one application to the another appl in the same container?

    I have a question.
    Can I send JMS message from one application to the another application in the same container?
    If yes ...can you provide me info.
    I want to know in regards of EJB2.0 and EJB3.0.
    Thanks,
    Rahul

    So the receiver application is a Message Driven Bean, right?
    In your container, do you have a mean to ensure that it is correctly configured to listen the desired destination? Like an administrative console that would show the destinations, the number of pending messages, the number of active consummers...?
    btw what is the destination type? A queue or a topic?

  • Putting both xml document and plain text in to the same container

    I have some configuration files written in plain text with the format 'key' = 'value'
    I want to put them into the same container with my xml document, is this possible?
    thanks

    Hi,
    yes it is. There are a couple of ways:
    1) Wrap into some XML tags and put your settings as an XML document (bad way)
    2) Use metadata of documents. You can store your plain text as metadata associated with some XML document. Also you can store a document only with metadata (i.e. with empty XML content).
    Vyacheslav

  • What was the exact functionality of "Device Control/Status.vi" (version 5)? Is there any vi in Labview 6.1 which performs the same tasks?

    I have a vi developed in LabVIEW 5.1 and I want to upgrade it to LabVIEW 6.1. So I must replace "Device Control/Status.vi" with a newer one but I do not know wich vi performs the same tasks in v6.1

    The Device Control/Status.vi is included with LabVIEW 6.1 as part of the serial compatibility VIs. You can find it by opening up and looking at
    Instrument I/O -> I/O Compatibility -> Serial Compatibility -> Bytes At Serial Port.vi
    Also, if you open up the VI found in
    vi.lib/platform/_sersup.llb/serial line ctrl.vi
    it will expose the functionality of Device Control/Status
    Thanks,

  • Why all JMenuItem's of JPopupMenu perform the same action?

    Why all JMenuItem's of JPopupMenu perform the same action?
    I trying to do something similar to what there is in JBuilder where you right click a method or a class - you get a popUpMenu and if you choose the
    "Browse Symbol" JBuilder browses to that method/class.
    I'm trying to do the same and to browse to some class of mine (not a java class). But there's a problem.
    This is my code : -
    OMClass desiredClass = event.getNavigationClass();
    if(desiredClass instanceof OMComplexClass) {
    Set classSet = desiredClass.getSimpleClasses();
    JPopupMenu menu = new JPopupMenu();
    JMenuItem menuItem = null;
    menu.add("Browse to :");
    menu.addSeparator();
    Iterator it = classSet.iterator();
    for(; it.hasNext(); ) {
    OMConcept concept = (OMConcept)it.next();
    menuItem = new JMenuItem(concept.getName());
    menuItem.addActionListener(new NavigateToComplexClass(concept));
    menu.add(menuItem);
    menu.show((JComponent)(event.getMouseEvent().getSource()), getX(), event.getMouseEvent().getY());
    ComplexClass is build of SimpleClasses - so if I want to browse to complex class I ask the user by a JPopupMenu what specific SimpleClass he would like to browse to. My ActionListener is a NavigateToComplexClass class - and hewe is the code : -
    public class NavigateToComplexClass implements ActionListener, ItemListener {
    private static OMClass classToShow = null;
    GUI_Location currentLocation = null;
    public NavigateToComplexClass(OMConcept desiredClass) {
    classToShow = (OMClass)desiredClass;
    public void actionPerformed(ActionEvent evt) {
    currentLocation = frame.fillGUI_Location();
    frame.getProject().getHistoryManager().updateHistory(currentLocation);
    if(classToShow == null) {
    return;
    frame.getClassDisplay().getTabbedPane().setSelectedIndex(1);// 1 - parameeter : Property tab.
    frame.getConceptViewPanel().selectConcept((OMConcept)classToShow);
    public void itemStateChanged(ItemEvent e) {
    The problem is that no matter what JMenuItem I select and press it's navigating to the same simpleClass like if I have a
    b
    c
    no matter what I'll press I'll always goto a (or b or c but always the same)

    hi,
    for your actionlistener all those items are more or less the same. when browsing to them you have to give them different names or better different actioncommands.
    regards

  • Using Local EJB obect in web container that installed in on the same Web AS

    we can use the local ejb object in the application that runs in same JVM.
    The Web Container and EJB Container run in the same JVM when Web AS installed as Minimum Cluster Installation(one cluster node).
    But, what happened if we install the Web AS as Large Cluster Installation? Can we still use the local ejb objects in the Web Container?
    Best regards,
    Raja
    Message was edited by: Raja Nasrallah

    Hi Raja,
    Yes you can. When you use local EJB objects there's no remote communication and the web container will find them in the EJB container of the local cluster node. For the application providers this is transparent - they shouldn't care about the configuration of the cluster.
    Best regards,
    Vladimir
    PS: Please consider <a href="https://www.sdn.sap.com/sdn/index.sdn?page=crp_help.htm#lostme">rewarding points</a> for helpful answers.

  • Live discussion on "EJB Performance Verification"

    Empirix, the maker of the Bean-test EJB testing tool, is offering a
    free one hour web event presentation called "Enterprise JavaBeans
    Performance Verification". This event will be held this Friday
    November 16th at 2pm EST.
    To register for this web event or learn about about web events being
    offering by Empirix, go to: http://webevents.empirix.com/Q42001/
    Enterprise JavaBeans Performance Verification
    Enterprise Java Beans (EJBs) are the central components in a
    Java-based enterprise architecture solution. They contain the business
    logic for an enterprise system and implement the communication between
    the Web-tier and database tiers. EJBs typically are architected and
    implemented for months before integrating with the Web-tier hardware
    and software. Waiting to verify the scalability of the overall EJB
    design and the efficient implementation until late in the software
    project with a Web test tool is risky and may cause the entire
    software project to fail.
    Due to the important role EJBs play, performance testing of the EJB
    architecture and implementation is critical during the entire design
    cycle, the test cycle, application server tuning, and with any
    hardware and software environment changes. Manual vs. automated EJB
    component verification strategies will be discussed. During the
    presentation, we will show how an example EJB will be scalability
    tested using Bean-test, Empirix's automated EJB component test tool.
    We will show how Bean-test automatically creates a test harness,
    exercises an EJB under load, isolates a scalability problem, and
    confirms an implemented correction to the scalability problem is
    successful.

    Note, there is a replay of this free web event on Monday, December
    10th at 2pm EST for those who could not make it the first time.
    Steve
    [email protected] (Steven Kolak) wrote in message
    Empirix, the maker of the Bean-test EJB testing tool, is offering a
    free one hour web event presentation called "Enterprise JavaBeans
    Performance Verification". This event will be held this Friday
    November 16th at 2pm EST.
    To register for this web event or learn about about web events being
    offering by Empirix, go to: http://webevents.empirix.com/Q42001/
    Enterprise JavaBeans Performance Verification
    Enterprise Java Beans (EJBs) are the central components in a
    Java-based enterprise architecture solution. They contain the business
    logic for an enterprise system and implement the communication between
    the Web-tier and database tiers. EJBs typically are architected and
    implemented for months before integrating with the Web-tier hardware
    and software. Waiting to verify the scalability of the overall EJB
    design and the efficient implementation until late in the software
    project with a Web test tool is risky and may cause the entire
    software project to fail.
    Due to the important role EJBs play, performance testing of the EJB
    architecture and implementation is critical during the entire design
    cycle, the test cycle, application server tuning, and with any
    hardware and software environment changes. Manual vs. automated EJB
    component verification strategies will be discussed. During the
    presentation, we will show how an example EJB will be scalability
    tested using Bean-test, Empirix's automated EJB component test tool.
    We will show how Bean-test automatically creates a test harness,
    exercises an EJB under load, isolates a scalability problem, and
    confirms an implemented correction to the scalability problem is
    successful.

  • Ejb lookup and oc4j container startup

    I have a servlet that is set to auto start on container startup that does a lookup on a ejb in another container. jndi locates the ejbhome but fails to load the class for the ejb home. It knows the name of the class but the classloader cannot find it. This same servlet works fine after the container has started up.
    It feel the problem is a classloader problem or a restriction by oracle. Any help is appreciated.
    Why can't the OC4J default application that auto starts servlets at container startup not find the ejbhome class?
    David Jacobs

    We have previously done it, but it only worked when we are using in 10g AS R1. But now, we are porting to R2, but it doesn't work. We didn't do any other things, just a simple lookup using the url, context factory. In R1 it worked fine, in R2, we are encountering the same, NameNotFoundException. Hope someone could help us also with this. Another thing, when we are using ormi://<rest of url>, it doesn't return any exception and our application hangs, but if we use opmn:ormi://<rest of URL>, that's the time it throws the NameNotFoundException. In R1, we didn't have any problems.

  • Invoking 5.1 EJBs from 6.1 container?

    Hi,
    While trying to invoke a session bean deployed to a 5.1 instance from a
    component in a 6.1 container I got a
    weblogic.socket.UnrecoverableConnectException (incompatible versions -
    server:5.1.0 client:6.1.0) exception. Does it mean that in order to invoke
    EJBs on another WLS instance both need to be at the same version (whatever
    happened to J2EE's distributed architecture and interoperability) ?
    Or am I missing something here?
    Thanks and regards,
    Damian

    In the interim, are there any other ways to achieve interoperability? For
    instance, will using plain http instead of T3 help?
    Thanks,
    Damian
    On 9/10/01 0:53, in article [email protected], "Andy Piper"
    <[email protected]> wrote:
    Damian Kwok <[email protected]> writes:
    While trying to invoke a session bean deployed to a 5.1 instance from a
    component in a 6.1 container I got a
    weblogic.socket.UnrecoverableConnectException (incompatible versions -
    server:5.1.0 client:6.1.0) exception. Does it mean that in order to invoke
    EJBs on another WLS instance both need to be at the same version (whateverCorrect.
    We are working on providing interop between 5.1 and 6.1 via IIOP, but
    no details as yet.
    andy

  • Ejb performance issue

    Hi
    As ejb1.1 makes call on network and not on local , it takes more time and hence less performance.
    In the whole application which we developed , everything is on single box .
    I am using jboss2.1 , is there any setting which could be done in ejb server with which it should start making calls in local and not on network
    regards
    prateek

    JBoss is pretty smart and works out whether to make inter-bean calls via RMI or by reference for you. JBoss is a fast container so if you are finding your code too slow have a look at your design - that's where most of performance improvements can be made.
    Ian.

Maybe you are looking for

  • Can you access UK itunes purchases in Australia?

    I want to gift a tv show available from the UK itunes store to another UK itunes account. The recipient is temporarily in Australia. Will he be able to download the gifts by logging into his account down under? Many thanks, Mike

  • Column selected at run time in ALV!!

    Hi, IS ther any way to know how many fields have been hidden on the output list of ALV... any indicator that gets set once we hide some field.... as i need to send only those columns which are selected as layout from the output list... Regards Gunjan

  • HDV print to tape? Help.

    I can't seem to get my HDV sequence to print to tape. I am new to the whole HDV thing so bear with me. I am using a sony HVR-V1U. Sequence Settings: Frame size: 1440x1080 Pixel Aspect Ratio: HD 1440 x 1080 Editing Time Base: 29.97 (can't Change) QT v

  • Java is very slow on terminal servers

    Hi, we have several terminal servers for clients. But running Java (JRE) on a bank website, is very slow to load the Java plugin. So the whole login takes around 1-2mins to complete. We run Windows Server 2008 R2 which is virtualized with VMWare, we

  • Spotlight? Not even a glimmer in 10.4.7

    Spotlight has disappeared. The icon is still there on the menu bar, but nothing happens on clicking it. I have removed/replaced the Prefs with no result. This may have happened when I downloaded/installed (using Software Update) OSX10.4.7, but I can'