Is the Remote EJBObject multithreaded?

Discussions

EJB design: Is the Remote EJBObject multithreaded?

  1. Is the Remote EJBObject multithreaded? (2 messages)

    I'm a newbie to EJB... Going thru the description of entity beans I understood that there exists only one remote object & bean instance for a particular data entity (eg. customer #28) across multiple clients. This wud consequently mean that the Remote EJBObject is multithreaded... am I right in this assumption?

    Best Regards,
    Anand.
  2. for a certain entity bean you have a single EJBHome object which is used for finding/creating/destroying the EJBObjects. Let's take as an example a User entity bean. You have a single home object, and you want to do some operations on the user "John". You look for this user (findByPrimaryKey("John") if this is your primary key)using the home object and you get after this an ejbobject for this user. You can now operate on user "John". If you also want to make changes on user "Sergiu" you find it also using findByPrimaryKey("Sergiu") and you can now call get/set or any other business methods you may have. If you are using User "Sergiu" and some other transaction wants to use the User "Sergiu" it will work on another ejbobject which is a copy of the object you are using.
    Hope you got the point ;)).

    A bean may be multithreaded if you use <reentrant>True</reentrant> inside the deployment descriptor of that bean and this means that:

      in bean A you are calling bean B and bean B calls back bean A, that the process has turned back to bean B. Only if you have set reentrant to True this code will work.

    Sergiu
  3. hihi...I said it kind of messy...so

      If in bean A you are calling bean B and bean B calls back bean A, than the process has turned back to bean A(this is some kind of multithreading). Only if you have set <reentrant/> to True this code will work.