350 likes | 556 Views
DM203 Enterprise Java Beans in Adaptive Sever Enterprise. Girish Vaitheeswaran Senior Software Engineer Database Server Technologies girish@sybase.com. An Introduction to EJB To EJB or not to EJB EJB and ASE what’s the nexus ASE-EJB Architecture ASE-EJB Architecture Components
E N D
DM203Enterprise Java Beans inAdaptive Sever Enterprise • Girish Vaitheeswaran • Senior Software Engineer • Database Server Technologies • girish@sybase.com
An Introduction to EJB To EJB or not to EJB EJB and ASE what’s the nexus ASE-EJB Architecture ASE-EJB Architecture Components ASE-EJB Interface Developing and Deploying EJB Components Contents
High Availability Unified Login and Role Mapping Conclusions References Questions Contents
Enterprise Java Beans is a standard server side component model for the development and deployment of distributed enterprise-level applications Applications written using the EJB architecture are scalable, transactional and multi-user secure Write once run anywhere Writing business logic in java helps improve flexibility and ease of writing components Code reuse helps rapid application development What is EJB
Types of EJB’s Session bean An extension of the client application responsible for managing processes or tasks. It models interactions but does not have any persistent state. Example : A Travel agent bean making a reservation for a cruise. What is EJB
Types of EJB’s (cont) 2 types of Session beans Stateful session bean - They maintain in -memory state information of the conversation between the client and the bean Stateless session bean - Do not maintain conversational state hence is more scalable What is EJB
Types of EJB’s (cont) Entity bean These represent persistent records in some kind of database. An entity bean has a persistent state. Example : A customer, a piece of equipment, an item in inventory etc What is EJB
EJB Component development task list JDBC connection to a data source Standard DML operations such as selects, updates, inserts and deletes Develop and Deploy using an IDE or a Systems Management interface for EJB Servers Typically need to have a 3 tier setup with an EJB Server in the middle tier EJB and ASE what’s the nexus
What does all this imply Connections to the database over the network are known to be expensive Data sets being transferred over the network can be large and can cause significant latency Security can be a factor since data is being transferred over the wire Knowledge of new development and deployment tools for component development, deployment and management are required Managing the complexities of a 3 tier architecture EJB and ASE what’s the nexus
Problem definition Performance Impact Security Impact Lack of Flexibility EJB and ASE what’s the nexus
EJB Support in ASE is the solution High Performance Communication High Speed Communication through ASE’s shared memory Secure data transfer No data transfer over the wire Complete Flexibility EJB’s can be deployed either in the middle tier or in the database tier EJB and ASE what’s the nexus
EJB Support in ASE is the solution Consolidation approach where the EJB Server can be managed as part of the Database Server Management using a single interface like Sybase Central plug-in for ASE Simple, easy to use T-SQL interface for performing various system management tasks EJB and ASE what’s the nexus
3 Tier Architecture Engine 3 JDBC request EJB Request Engine 2 Engine 1 Data Set Response Client EJB Server Database Server
2 Tier Architecture EJB Server Engine 3 Engine 2 EJB Request Engine 1 Response Client Database Server + EJB Server
Engine 1 Engine 0 2 Tier Architecture.. Details EJB Request EJB Server Response Client High Speed JDBC Driver Database Server
Database Server Responsible for spawning the EJB Server Responsible for responding to isql and ct-lib requests Listens on the TDS port EJB Server Responsible for responding to EJB requests Listens on the IIOP port Responsible for executing component methods ASE-EJB Architecture Components
High Speed JDBC driver Facilitates high speed communication between ASE and the EJB Server This bi-directional communication between ASE and the EJB Server happens through ASE’s shared memory to which the EJB Server is attached to. ASE-EJB Architecture Components
Configuration Parameters New Configuration parameter ‘enable enterprise java beans’ to enable/disable EJB support in ASE with a valid ASE java feature license This is a dynamic option ASE-EJB Interface
Sybase Central plug-in for ASE Used to Configure a new EJB Server Used to specify the logical name, physical name and the port number where the EJB Server would listen Used to deploy components Used to Manage packages, components, listeners, connection caches etc Look and feel similar to Jaguar Manager ASE-EJB Interface
SQL Interface and Stored Procedures sp_extengine: Used to start, stop and query the status of the EJB Server Syntax is as follows sp_extengine @logical_servername, @class, @command @logical_servername is the logical name of the EJB Server ASE-EJB Interface
SQL Interface and Stored Pr. (cont) Syntax (cont) @class is the class of servers, ASEJB is a new class @command is the command to be performed on the EJB Server and includes “start”, “stop” and “status” E.g.. sp_extengine “EJBServer”, “ASEJB”, “start” ASE-EJB Interface
SQL Interface and Stored Pr. (cont) Shutdown automatically shuts down the EJB Server also An EJB Server cannot exist as a stand alone entity and has to have an ASE associated with it ASE-EJB Interface
Shared Memory Driver To use the High Speed Shared Memory driver the following System Property needs to be set SYBSOCKET_FACTORY=com.sybase.shmem.ShmemSocketFactory ASE-EJB Interface
PowerJ The IDE of choice to develop and deploy Enterprise Java Bean applications in ASE Has the option of deploying the EJB either in the middle tier or in the database tier Helps in the generation of stubs and skeletons Developing and Deploying EJB Components
Sybase Central Plug-in for ASE Helps in the generation of stubs and skeleton code and also in the deployment of the components in the EJB Server Developing and Deploying EJB Components
High availability support for session beans is automatic for an ASE/EJB Server pair If EJB Server A and EJB Server B were made part of a cluster, then when EJB Server A fails while executing a session bean, the client EJB request would automatically be serviced by EJB Server B For a stateful session bean, the state of the bean is stored in the database High Availability
For entity bean support, the database being used as a storage for the entity bean, needs to be configured as a proxy database in the companion server High Availability
High Availability EJB Request Primary db Response Primary ASE Client Proxy db Companion ASE
High Availability EJB Request Primary db Response Primary ASE Client Proxy db Companion ASE
High Availability Primary db Primary ASE EJB Request Proxy db Response Client Companion ASE
A Single Login and Password interface is provided to login to both ASE and the EJB Server Role Mapping is done in order to ensure users with the right privileges have the authority to perform the appropriate actions The roles are maintained in ASE Unified Login and Role Mapping
Significant performance benefits when Enterprise Java Beans with a lot of database operations are deployed in ASE Secure communication between ASE and the EJB Server happens through shared memory A Seamless interface can be used to develop, deploy and manage EJB Components Conclusions
Sun’s EJB Specification Enterprise Java Beans by Richard Monson-Haefel References
Session No. DM203Enterprise Java BeansinAdaptive Sever Enterprise • Girish Vaitheeswaran • Senior Software Engineer • Database Server Technologies • girish@sybase.com