Wednesday, February 07, 2007

Why are you not using Entity EJB 1.1?

I am currently quite busy learning about Websphere Commerce. I was surprised to notice that they still use Entity EJBs 1.1. My experience was that many companies turned away from Entity EJBs, sometimes from the beginning, preferring TopLink or Hibernate (later).
 
I know that Entity EJBs are more heavy to use than Hibernate, but with the proper tooling support, it's not really a big issue. Are there more fundamental reasons? There are probably some mapping limitations, but IBM implementation is apparently quite good in term of features.
 
I will write a complete post about my own analysis of EJB 1.1 vs IBM EJB 1.1 vs EJB 3.0 vs Hibernate, but I was wondering first what was your feedback on EJB 1.1.

3 comments :

  1. Hi,

    We were using EJB 1.1 at 2002 with Websphere Application Developer & WS Application Server. Testing components that use Entity Beans at the back was more difficult than the parts that make use of DAOs. IBM's tool was not stable, for example it was not giving proper error messages when something is wrong in mapping files. Also IBM's deployment tools was sometimes failing with unknown reasons. Since that time I hate XML, an I try to keep out of XML as much as I can.

    ReplyDelete
  2. I'm with Deniz on this one, plus the following:
    * Modifying an EJB means recreating and deployiung the whole EAR. Not a nice thing to do with IBM tools (depending on you memory availability and number of EJB, this process can take longer than an hour).
    * If you have a transaction that involves several EJB instances, all of them are kept in memory. There was no way to finetune this.
    * Forget about doing batch processing when EJBs are involved.

    ReplyDelete
  3. compared to the present ejb 3 or hibernate, ejb 1.1 is no match. Some of the biggest reasons for not to use ejb 1.1 are
    1. Limitations in EJBQL. It is pretty naive. Complex queries are almost impossible
    2. n+1 problems will show its ugly face for anything but the most trivial of applications
    3. If i remember right, EJB 1.1 didnt have local interfaces, so EJB to EJB communication is also implicitly remote even though application servers optimized it if the EJBs were collocated.
    4. Features like session cache, second level cache, inheritance mapping etc are either very difficult or impossible

    and much much more...

    So, if you have a choice my sincere recommendation would be to move to some modern orm framework like hibernate.

    ReplyDelete