Stored procedure support for CMP EJB

A stored procedure serves as an extension to clients that run on a backend datastore. The stored procedure can be invoked with a CALL statement from a client application or from another routine.

The Container-Managed Persistence (CMP) Entity JavaBeans (EJBs) in WebSphere Business Integration Server Foundation version 5.1 extends the existing J2EE CMP EJB programming model to utilize the well-known stored procedure feature to push down the CMP EJB methods to the backend store. A mapping mechanism is provided by the Application Server Toolkit (ASTk) and WebSphere Studio Application Developer-IE 5.1 to enable bean developers to map the bean's data logic methods and the CMP EJB accessor methods to the legacy procedures.

The trigger to this mechanism is the PME deployment descriptor extensions. There is a PushDownMethodElement defined for each method that you want to implement with a stored procedure. The logic that accesses the stored procedure (legacy or specially-written) is provided by a user-writtenclass which plugs in to the CMP EJB support of WebSphere. The result is that the bean's data logic is simplified and utilizes the existing legacy procedures that have been fully tested.

A beanUserDefinedPushDownMethod interface is introduced so you can provide the implementation of this interface to access the stored procedures during the deployment of a CMP EJB.

The UserDefinedPushDownMethod interface and implementation class are generated when you use the ASTk to generate the push down method template. You must inject the logic that accesses the stored procedures in this implementation class. This class is called by WebSphere to perform the procedure invocation during runtime.

There are three kinds of stored procedures in a business environment:

A stored procedure can be an SQL procedure, a Java procedure, or any existing legacy procedure. You can use JDBC or SQLJ to access an SQL stored procedure or Java stored procedure, or you can use a mechanism such as WSIFOperation to execute any non-relational procedure.

The ability to create a CMP EJB as the front-end to appropriate stored procedures lets you enjoy the benefits of using CMP EJBs and stored procedures at the same time. These benefits include:

To summarize, all the reasons for using CMP EJBs still apply, when you choose to use stored procedures instead of a direct SQL operation to access your persistent data.

The following links provide additional information concerning the relational stored procedure that uses a CMP EJB. For non-relational stored procedure information, refer to Container Managed Persistence over anything.


Related tasks
Developing a CMP EJB that uses stored procedure
Deploying a CMP EJB that uses stored procedure
Related topics
WSRelationalPushdownHelper
WSPushDownHelperFactory



Searchable topic ID:   cmpstorproc
Last updated: Jun 21, 2007 8:07:48 PM CDT    WebSphere Business Integration Server Foundation, Version 5.0.2
http://publib.boulder.ibm.com/infocenter/wasinfo/index.jsp?topic=/com.ibm.wasee.doc/info/ee/ae/cdat_cmpstorproc.html

Library | Support | Terms of Use | Feedback