What is EJB

Unofficial Content

Enterprise Java Beans(EJB) technology is the server-side component architecture for J2EE platform. EJB technology enables rapid and simplified development of distributed, transactional, secure and portable applications based on Java technology.

There are 3 types of Enterprise Java Beans:

  1. Entity Beans
  2. Session Beans
  3. Message Driven Beans

Entity Beans simplify the data access coding, and offer a more object-oriented interface than JDBC.

Session Beans are components that encapsulate processes run in the application server. There are two types: those that keep state information between calls and those that don't. To access the database, Session Beans can either use Entity Beans or JDBC.

Message Driven Beans are similar to Session Beans but are called asynchronously.

Message Driven Beans are generated as TextMessage and MapMessage when they receive only one character parameter; and only of MapMessage type in the other cases .

GeneXus will not generate Entity Beans because they don't add value for the GeneXus users since they don't manually code the data access. Besides, it would have a significant performance cost due to some limitations of the current implementations.

GeneXus generates Session Beans and Message Driven Beans, as well as GX use JDBC for database access. These components may be executed from the GeneXus application itself or by third parties.

It is also be possible to import the definition of an outer Session Bean/Message Driven Bean and use it from GeneXus . To do so, the Java generator must be used. This can be done by using external objects.