Title: DM203 Enterprise Java Beans in Adaptive Sever Enterprise
1DM203Enterprise Java Beans in Adaptive Sever
Enterprise
Girish Vaitheeswaran Senior Software
Engineer Database Server Technologies girish_at_sybas
e.com
2Contents
- An Introduction to EJB
- To EJB or not to EJB
- EJB and ASE whats the nexus
- ASE-EJB Architecture
- ASE-EJB Architecture Components
- ASE-EJB Interface
- Developing and Deploying EJB Components
3Contents
- High Availability
- Unified Login and Role Mapping
- Conclusions
- References
- Questions
4What is EJB
- 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
5What is EJB
- Types of EJBs
- 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.
6What is EJB
- Types of EJBs (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
7What is EJB
- Types of EJBs (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
8EJB and ASE whats the nexus
- 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
9EJB and ASE whats 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
10EJB and ASE whats the nexus
- Problem definition
- Performance Impact
- Security Impact
- Lack of Flexibility
11EJB and ASE whats the nexus
- EJB Support in ASE is the solution
- High Performance Communication
- High Speed Communication through ASEs shared
memory - Secure data transfer
- No data transfer over the wire
- Complete Flexibility
- EJBs can be deployed either in the middle tier
or in the database tier
12EJB and ASE whats 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
133 Tier Architecture
Engine 3
JDBC request
EJB Request
Engine 2
Engine 1
Data Set
Response
Client
EJB Server
Database Server
142 Tier Architecture
EJB Server
Engine 3
Engine 2
EJB Request
Engine 1
Response
Client
Database Server
EJB Server
152 Tier Architecture.. Details
EJB Server
EJB Request
Response
Client
High Speed JDBC Driver
Database Server
16ASE-EJB Architecture Components
- 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
17ASE-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 ASEs shared
memory to which the EJB Server is attached to.
18ASE-EJB Interface
- 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
19ASE-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
20ASE-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 _at_logical_servername, _at_class,
_at_command - _at_logical_servername is the logical name of the
EJB Server
21ASE-EJB Interface
- SQL Interface and Stored Pr. (cont)
- Syntax (cont)
- _at_class is the class of servers, ASEJB is a new
class - _at_command is the command to be performed on the
EJB Server and includes start, stop and
status - E.g..
- sp_extengine EJBServer, ASEJB, start
22ASE-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
23ASE-EJB Interface
- Shared Memory Driver
- To use the High Speed Shared Memory driver the
following System Property needs to be set - SYBSOCKET_FACTORYcom.sybase.shmem.ShmemSocketFa
ctory
24Developing and Deploying EJB Components
- 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
25Developing 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
26High Availability
- 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
27High 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
28High Availability
EJB Request
Primary db
Response
Primary ASE
Client
Proxy db
Companion ASE
29High Availability
EJB Request
Primary db
Response
Primary ASE
Client
Proxy db
Companion ASE
30High Availability
Primary db
Primary ASE
EJB Request
Proxy db
Response
Client
Companion ASE
31Unified Login and Role Mapping
- 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
32Conclusions
- 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
33References
- Suns EJB Specification
- Enterprise Java Beans by Richard Monson-Haefel
34Questions
35Session No. DM203Enterprise Java Beans in
Adaptive Sever Enterprise
Girish Vaitheeswaran Senior Software
Engineer Database Server Technologies girish_at_sybas
e.com