×

Loading...

Topic

This topic has been archived. It cannot be replied.
  • 工作学习 / IT技术讨论 / Dear Jabber, Could you please give me a hand?(also about EJB)
    This time I face the problem about calling methods between EJBs. For example, if there are two beans, how to call the method of bean A from bean B. I know the getEJBObject( ) method is useful under such condition. But how to pass a reference to the second bean and is it necessary to call method by Home Interface just regarding the first bean as a client?

    Furthermoe, if the two beans are in different containers, is the solution the same?
    • The first Bean is the second Bean's client.
      So you need use EJB client API and JNDI. Get the remote interface first.....

      By the way, getEJBObject() does not help you much. EJBObject is an interface...

      The same procedure applies if the two beans are in the different containers.
      • Thanks for your guidance! And could you please tell me is it feasible for an entity bean to embody many tables, not just one bean, one table?
        • It is challeging to make an EntityBean is associated with a row in a view....
          I suggest you download EJB speficiation from sun's site. In the development, there are a lot of headaches.
          • Thanks! I have downloaded the specification. However...
            after inputting "tables" or "row" into the FIND FUNCTION, I don't get what I want. Could you please explain it detailedly what's the meaning of "a row in a view" in your answer?

            Now I am a little bit confused about the method of studying EJB. You know, the specification have 558 pages and another EJB book I have been reading have 738 pages. I don't know exactly when I will finish reading so many pages and when I will write codes for the project?

            It's really a tough winter!
            • EntityBean ususally persist to a Table in a DB.
              Sometimes, people may ask it to associated with a View in DB. Headaches are here...

              Some people try to avoid mapp an Entitybean to a View in DB. They choose to desigb bigger tables.

              One of my friends has ever designed a table with 16 column because his EntityBean has 16 attributes. I did not dispute with him because he is my friends. But I do think his design is problamatic. From my perspective, a Table iwth 16 columns is likely to be a poorly normalized one.

              Many people are doing EJB projects but the performance is generally poor.

              I don't think you need finsih the whole book.
              EJB Specification is a reference, not a textbook. I think following some examples shipped with EJB container is more useful than going through the whole book.
              • Thanks a lot!!! You are right that...
                I have learned something about EJB recently but do lack of practical experience. My plan is to understand the essential of EJB first and then do it by myself.

                The IDE I use is JBuilder 4.0 and back-end database is Oracle 8. There are several good examples in JBuilder. I will research them and thank you for your kindness again!