Package examples.ejb 2.0

The examples in this package illustrate different aspects of using 2.0 EJBs. Note that most examples have been removed from the WebLogic Server 8.1 Beta; a full complement of API examples will be included with the General-Availability release of WebLogic Server 8.1.


  Examples Summary

examples.ejb20.basic.beanManaged Demonstrates the use of an entity EJB with bean-managed JDBC persistence written to the EJB 2.0 Specification.
examples.ejb20.basic.containerManaged Demonstrates the use of an entity EJB with container-managed JDBC persistence written to the EJB 2.0 Specification.
examples.ejb20.basic.statefulSession Demonstrates the use of a stateful session EJB written to the EJB 2.0 Specification.
examples.ejb20.basic.statelessSession Demonstrates the use of a stateless session EJB written to the EJB 2.0 Specification.
examples.ejb20.relationships.bands Demonstrates the use of EJB relationships, local interface, cascade delete, and client jar.
examples.ejb20.message Demonstrates the use of message-driven EJBs.
examples.ejb20.sequence.userDesignated Demonstrates the use of automatic primary key generation feature with a user designated database with an EJB.
examples.cluster.ejb Demonstrates how to write a clustered application with EJBs that exhibits load balancing and failover. .
 

Package EJB 2.0 Description

These examples demonstrate different aspects of 2.0 EJBs. It is a good idea to run all of these examples before attempting to create your own 2.0 EJBs. They will show you the different steps involved.

Pre-Built Examples

Some of the EJB 2.0 examples included in the WebLogic Server 8.1 distribution are shipped pre-built and others require user configuration before they can be run. When you start the examples server, the EJB 2.0 examples that are pre-built will display in the list of deployed EJBs, under the Deployments\EJB node in the left pane of WebLogic Server's Adminstration Console To run these examples, following the instructions in the package-summary.html file for each specific example.

For those EJB 2.0 examples, not shipped pre-built, you should follow the instructions in the specific example's directory to build, configure and then run the example.

Quick Guide to the EJB 2.0 Examples

The following table lists all of the EJB 2.0 examples by the feature demonstrated in the example. Note that this table includes EJB examples from other packages (cluster, jolt, etc.).

If you're interested in... ...then look at these examples:
Entity EJBs
Finders and finder expressions
Session EJBs
Calling an EJB from another EJB
EJB 2.0 relationships
EJB 2.0 local interfaces
Using Client.jar
Using cascade delete with EJB
Using a message-driven EJB
Using EJBs in WebLogic clusters

Building and Running the Examples

  1. Read the instructions for each example, found at the links above.
  2. Set up your development environment as described in Setting your development environment.
  3. Depending on the example, set up any special properties, such as database persistence.
  4. Most examples in this package are preconfigured to work with the PointBase Database which is part of the WebLogic Server distribution. However, if you need or want to run a specific example with Oracle, use the Oracle database setup instructions.
  5. Build each example, using the provided build scripts or makefile. We've provided instructions on using the build scripts.
  6. You can deploy each EJB by running the build script that places the EJB in WL_HOME\samples\domains\examples\applications in the WebLogic Server distribution, where it automatically deploys once the server is started. If you are already running the server and build another EJB, it is automatically placed in this directory and instantly deployed. If you build an example EJB with the supplied build scripts and deploy it, you can run the build script again and redeploy the bean from the same .jar.
  7. Refer to the specific instructions for each example to run that example.