Corporate Info | News | Solutions | Products | Partners | Services | Events | Download | How To Buy
Commerce Servers Doc Home | WebLogic Components Doc Home | Using WebLogic Components | Previous Topic | Next Topic | Contents

Deploying WebLogic Components Using Bean-Managed Persistence

This topic includes the following sections:

- Using Bean-Managed Persistence

- The Oracle Reference Implementations

- Deployment Sets Overview

- Deploying on Windows NT

- Deploying on Solaris

Using Bean-Managed Persistence

You can deploy the WebLogic Components examples using Bean-Managed Persistence.

It is now possible to map WebLogic Components to any database available through JDBC. BEA provides a reference implementation (deployment set) for bean-managed persistence. This is available as a deployment options in the WebLogic Components release. For more technical background, read about Deploying WebLogic Components with Enterprise Data Sources.

Here, we describe how to deploy the WebLogic Components software in the following environments:

- Deploying on Windows NT

- Deploying on Solaris

The example Oracle deployment set allows you to map the My BuyBeans.com components to Oracle 8.0.5.

BEA's Smart Generator has basic object/relational mapping features that generate up to 100% of the mapping from beans to a relational model using serialization. For complex databases the generated code serves as a starting point for reliable and scalable Bean-Managed Persistence that you can modify and fine-tune.

Note: For specific directions on deploying the My BuyBeans.com example portal on Oracle, see the Installation Guide.

The Oracle Reference Implementations

The Oracle reference implementation uses Oracle's object-relational features including database object types and nested tables. WebLogic Components are stored with a maximum transparency. You can query on every field in the example BuyBeans object model. This reference implementation is made available to help gauge the effort and complexity of more-detailed object-relational persistence.

If you have any comments, questions, or need help with a WebLogic-Oracle 805 deployment, please contact support@theorycenter.com.

- Oracle OCI Driver. The WebLogic-Oracle 805 deployment uses the Oracle Thin JDBC driver. If you want to use the Oracle OCI driver instead, you must re-run the ejb compiler and redeploy your beans using isolationLevel TRANSACTION_READ_COMMITTED in the deployment descriptors.

Additional Requirements

- BuyBeans.com examples successfully deployed using default container-managed persistence on the Windows NT or the Solaris operating systems.

- Oracle Thin driver for JDBC. These drivers can be downloaded from Oracle

Deployment Sets Overview

Deployment Sets give you the freedom to develop your business application independently from the application server or database vendors.

This separates business logic from the development environment and gives you the freedom to choose to develop in one environment and deploy in another. Each Deployment Set pertains to a particular combination of an application server and database.

There is a deployment set available for each of BEA's certified implementations on an application server and database. Deployment sets are available for:

- WebLogic

  - Using Container-Managed Persistence to a Cloudscape database

  - Using Bean-Managed Persistence to an Oracle 805 Database

The following table illustrates the matrix of servers and databases.

####

Table 4-1 Servers and Databases

#### Databases | #### Application Servers
--- | ---
Databases | WebLogic | NAS
Cloudscape | CMP | n/a
Oracle 8.0.5 | BMP | under development

Deploying on Windows NT

This reference example assumes you have installed the WebLogic Components CD or the download under c:\weblogicac .

1. Edit c:\weblogicac\bin\win32\sethome.bat

   - Change DEPLOYMENT_SET to %WEBLOGICAC_HOME%\deploy\weblogic\oracle805\classes

   - Change DB_CLASSPATH to your Oracle thin driver classpath.

   - Remove the DEPLOYMENT_SET and DB_CLASSPATH definitions for the Cloudscape deployment set.

2. Create the BuyBeans schema in your Oracle 8.0.5 or higher database.

   - Use c:\weblogicac\deploy\weblogic\oracle805\misc\BuyBeansOracle805.sql

3. Change the weblogic.properties file.

   - Rename the file c:\weblogicac\weblogic.properties to cloudscape-weblogic.properties . This saves the file so you can return to the CMP version at a later time.

   - Copy the file c:\weblogicac\deploy\weblogic\oracle805\misc\weblogic.properties to c:\weblogicac\weblogic.properties .

4. Replace the @WEBLOGICAC_HOME@ marker with c:\weblogicac (assuming you installed in c:\weblogicac ).

5. Edit the file c:\weblogicac\weblogic.properties .

   - Search for the properties named weblogic.jdbc.connectionPool.portal and weblogic.jdbc.connectionPool.jdbcPool. These are examples for using either the OCI or Thin driver. Modify the connection pools to use your database and password. See http://www.weblogic.com/docs/classdocs/API_jdbct3.html#connpools for further help.

6. Start the WebLogic server using c:\weblogicac\StartPortal.bat .

7. Verify the following in the server log:

   - Verify that the portal and jdbcPool connection pools were successfully created.

   - Verify that all EJBs successfully deployed.

8. Load the database

   - Use c:\weblogicac\bin\win32\itemloader.bat with the following qualifiers:

   - -url use the name and port of the machine where you deployed the weblogic server. Example: http://localhost:7601/

   - -tabdelimitedfile c:\weblogicac\deploy\weblogic\oracle805\misc\BuyBeans.txt .

   - Use c:\weblogicac\bin\win32\shippingmethodsloader.bat with the following qualifiers:

   - -url use the name and port of the machine where you deployed the weblogic server. Example: http://localhost:7601/

   - -commadelimitedfile c:\weblogicac\deploy\weblogic\oracle805\misc\shippingmethods.txt

9. Start your web browser. Enter the url with the name and port of the machine where you deployed the WebLogic server. You will have to register a new user with username "cool" and password "bean".

10. You are now using BEA's Bean-Managed Persistence!

Deploying on Solaris

This example assumes you have installed the WebLogic Components download into /weblogicac .

1. Edit /weblogicac/bin/solaris2/sethome.sh

   - Change DEPLOYMENT_SET to $WEBLOGICAC_HOME/deploy/weblogic/oracle805/classes

   - Change DB_CLASSPATH to your Oracle thin driver classpath.

   - Remove the DEPLOYMENT_SET and DB_CLASSPATH definitions for the Cloudscape deployment set.

2. Create the BuyBeans schema in your Oracle 8.0.5 or higher database.

   - Use /weblogicac/deploy/weblogic/oracle805/misc/BuyBeansOracle805.sql

3. Change the weblogic.properties file.

   - Rename the file /weblogicac/weblogic.properties to cloudscape-weblogic.properties . This saves the file so you can return to the CMP version at a later time.

   - Copy the file /weblogicac/deploy/weblogic/oracle805/misc/weblogic.properties to /weblogicac/weblogic.properties .

4. Edit the file /weblogicac/weblogic.properties .

   - Search for the properties named weblogic.jdbc.connectionPool.portal and weblogic.jdbc.connectionPool.jdbcPool. These are examples for using either the OCI or Thin driver. Modify the connection pools to use your database and password. See http://www.weblogic.com/docs/classdocs/API_jdbct3.html#connpools for further help.

5. Start the WebLogic server using /weblogicac/StartPortal.sh .

6. Verify the following in the server log:

   - Verify that the portal and jdbcPool connection pools were successfully created.

   - Verify that all ejb's successfully deployed.

7. Load the database

   - Use /weblogicac/bin/solaris2/itemloader.sh with the following qualifiers:

   - -url use the name and port of the machine where you deployed the weblogic server. Example: http://localhost:7601/

   - -tabdelimitedfile /weblogicac/deploy/weblogic/oracle805/ misc/BuyBeans.txt .

   - Use /weblogicac/bin/solaris2/shippingmethodsloader.sh with the following qualifiers:

   - -url use the name and port of the machine where you deployed the WebLogic server. Example: http://localhost:7601/

   - -commadelimitedfile /weblogicac/deploy/weblogic/oracle805/ misc/shippingmethods.txt

8. Start your web browser. Enter the url with the name and port of the machine where you deployed the WebLogic server. You will have to register a new user with username "cool" and password "bean".

9. You are now using BEA's Bean-Managed Persistence!

Copyright © 2000 BEA Systems, Inc. All rights reserved. Required browser: Netscape 4.0 or higher, or Microsoft Internet Explorer 4.0 or higher.