Types of Beans

Enterprise JavaBeans are distributed components that are deployed in application servers. Examples of commercial application servers are iPlanet Application Server, BEA Weblogic, IBM WebSphere, Oracle Application Server, and Sybase Jaguar. EJBs are distributed because they can run on separate virtual machines and application server nodes and communicate via RMI, Java’s Remote Method Invocation (which in most application server products is implemented by a CORBA IIOP stack). EJBs address two main tasks: providing business logic and representing data in an object- oriented view. In this chapter, you find out how these tasks are intimately linked to database access, and how the database access is actually done in practice.

There are two types of beans: session beans and entity beans. Session beans incorporate business logic for distributed applications. They behave as services, where methods can be invoked remotely from other beans, from servlets, or from client applications. A session bean normally doesn’t represent data; entity beans are used for this purpose. Both types have a well-defined life cycle managed by application servers, but explaining the details about creation, activation (moving a bean’s state from passivated to activated), passivation (moving a bean’s state from activated to passivated), and destruction of beans is beyond the scope of this book. This chapter focuses on the relevance of database access for both types of beans.

Note that both types of beans can use DataSource objects and connection pools provided by application servers, as well as transaction management on bean methods and underlying data sources.



JDBC 3. 0. JAVA Database Connectivity
JDBC 3: Java Database Connectivity
ISBN: 0764548751
EAN: 2147483647
Year: 2002
Pages: 148

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net