EJB - Performance issue (having more number of EJBs have effect on the performance)

后端 未结 2 470
梦谈多话
梦谈多话 2020-12-30 18:30

We are developing an application with around 400 database tables. and have equal number of EJBs (All are Local interfaces and EJB is stateless) and one EJB is injected into

2条回答
  •  天命终不由人
    2020-12-30 18:50

    Why would you have one EJB per table? JPA is the persistence mechanism normally used with EJB3, JPA-annotated classes are not EJBs. I would tend to express my EJB layer in terms of coarser grained objects. For example Order might be an EJB with an interface expressed in terms of OrderLines, which are not EJBs.

    Having said that, assuming that you are using local calls to your EJBs the run-time overhead need not be very excessive. You pay the cost of the JNDI lookups when you get the references, and the container needs to do a little work when dispatching a method (think about security and transactions) so there is bound to be some overhead, whether it's too much for your app only benchmarking can tell.

    My gut feel: you've got more EJBs than you need, and you will be happier with fewer.

提交回复
热议问题