|
WebLogic Server 7.0 Code Examples, BEA Systems, Inc. | |||||
See:
Description
| Interface Summary | |
| Stock | The remote interface for the StockBean read-only EJB. |
| StockHome | The home interface for the StockBean read-only EJB. |
| StockWriter | The remote interface for the StockWriterBean. |
| StockWriterHome | The home interface for the StockWriterBean. |
| Class Summary | |
| Client | This class illustrates how to use a read-only EJB and a read-write EJB together to provide "read-mostly" access to a set of data. |
| StockBean | StockBean is a read-only EntityBean. |
| StockWriterBean | StockWriterBean is an EntityBean. |
This example includes a read-only entity EJB called Stock and a read-write entity EJB named StockWriter. Both EJBs work together to provide "read-mostly" access to a set of data. See BEA WebLogic Server Enterprise Java Beans for more information about the read-only and read-write strategies for entity EJBs.
To get the most out of this example, first read through the source code files.
This EJB 1.1 example is not shipped pre-built. Before you can run this example, you must first build it following the instructions in Build the example.
After you are familiar with the classes and deployment files, follow the instructions in the following foru sections to build and run the examples:
This example is preconfigured to work with the PointBase database, included with the WebLogic Server distribution. As you'll use a database for the persistent storage of the entity EJBean, you'll need to set it up. Note that the persistent storage is completely invisible to the client; the actual storage is handled by the EJBean directly and not the container. With database persistence, each instance of an EJBean is written to a row in a table.
If you want or need to run this example with Oracle, see Database SetUp for instructions.
We provide a build script for you to build the example:
The build script is build.xml.
Run the build script using the following Java ant command:
prompt> ant
The script will build the example and place the files in the correct locations in your WebLogic Server distribution:
Running the build script places the EJB in the %applications% directory, where it automatically deploys once the server is started. Also, if you are already running the server and then build the EJB, it is automatically placed in this directory and instantly deployed.
Additional information on using the build scripts is found in Building Enterprise JavaBean examples
A list of deployed EJBs displays in the left pane.
If you need more information about how to use connection pools, read Programming WebLogic JDBC.
prompt> ant run
Beginning readMostly.Client... Creating a StockWriter for BEAS Looking up Stock info for BEAS BEAS: Price: 100.0 Volume: 1000 52 Week High: 100.0 52 Week Low: 100.0 Removing the StockWriter Ending readMostly.Client...
|
Documentation is available at http://e-docs.bea.com/wls/docs70 |
|||||