Search code examples
architectureejb-3.0pojo

To EJB3 or not?


I have an architecture scenario and I would like to discuss to get your opinion.

I can choose between these two (this is a constraint imposed on me)

  1. Use EJB3+JPA - no Spring/Hibernate
  2. POJO + JDBC - again no Spring/Hibernate

I have series of web applications (only intranet) that all need to be integrated. At database level, there will be 3 to 4 oracle databases (and about 40 to 50 tables per database). Some applications may interact with more than one database for some queries. Number of concurrent user(s) will be less than 100. User/audience per application will range from 10 to 6000 (max).

All applications will be deployed on one server, and it's very likely that database and server could be on the same machine.

Most of the use cases will be CRUD based (some can offer a good domain model for an ORM while others may not), with some business process, automated jobs etc There may be a future need to integrate with SAP for some applications.

Do you think EJB3 in this case will make the application more scalable or just add complexity? If I design with POJO, will an application of this I don't want to add complexity for no good reason. I tried to lobby for Spring and Hibernate but no success.

let me know if you need more details.

EDIT: I forgot to mention the application server. it's WAS 7.


Solution

  • I can't see how JPA would be permitted, but Hibernate wouldn't. That doesn't make a lot of sense, given that Hibernate is a JPA implementation. Would another JPA implementation be OK, such as OpenJPA?

    You haven't mentioned if you have an existing server, or will be installing your apps on a yet-to-chosen server. Has this decision already been made? If so, that may dictate your choice. A full, up-to-date JavaEE server will come with EJB3 and JPA implementations already.

    If the server isn't an EJB3-enabled server, then EJB3 is much less compelling.

    But if sensible technologies such as Spring and Hibernate have been ruled out, there always simple frameworks like iBatis that allow you to combine POJOs with JDBC.