EJB design: EJB: Is Entity bean resource intensive?

  1. EJB: Is Entity bean resource intensive? (4 messages)

    I am building a web application on Netscape Application Server. I did not use Entity Bean to model the business objects and database because I was told that Entity Beans are resource intensive and thus may have some performance issues. How exactly are entity beans resource intensive? Is there any way around this problem?

  2. Philip,
      I'm not sure if there is a definite answer to your question. In certain circumstances, entity beans might prove to be resource intensive. At the same time, they also provide you with the ease of operations, while dealing with database data. If your application, does not require much of database manipulation, (viz. insert/update/delete) , perhaps, it may not be a good idea to create entity beans. It might make more sense to use JDBC result sets and servlets for applications that only need to read the data.
  3. Sunil,

      Thanks for your attention. In the J2EE framework, as of my understanding, session bean is used for business processing and application logic, while entity bean is suppose to be used to deal with database stuff, isn't it?

      However, in this project, as the resources-intensive thingy issues is raised, I'm now using session bean to initiate JDBC calls for database access. Is this an acceptable solution?
  4. Philip,

      Using a session bean for database access is definately an acceptable solution, however I would only recommend it for cases in which you will not be loading the same data over and over again. In this case, your app. servers ability to cache entity beans will not help, infact entity beans will probably slow you down.

    read the following other threads for more info:
    JDBC via session bean performance vs. queries via entity beans.
    Web Application Architecture questions .
    Problem with loading many entity beans..

    hope this helps.

  5. Dear all,

    Assistance and comments from you guys really help a lot. Thanks!