Chapter 27: Creating Entity Components
To use component-managed persistence, you must configure the component’s persistence properties and implement the required methods from the EntityBean or CtsComponents::ObjectControl interfaces. Display the Component Properties window in EAServer Manager and configure the following fields on the Persistence tab:
Primary Key Enter the name of the primary key type (see “Defining the primary key type”).
In most cases, no other persistence settings are required. You can delegate to EAServer’s built-in storage components rather than implementing your own database access code. If you do so, configure the Storage Component, Connection Cache, and Table fields (see “Storage components”). Delegation requires that you use the CtsComponents::DataStream and CtsComponents::Storage interfaces. See the generated Interface Repository documentation in your EAServer installation (in the html/ir subdirectory) for descriptions of these interfaces.
Improve performance: identify read-only methods For best performance when using component-managed persistence, mark all remote interface methods that do not modify data as read-only. To do so, select the Read Only check box in the Method Properties dialog box. When this property is enabled, the components ejbStore or ctsStore method is not invoked after the business method returns.
|Copyright © 2005. Sybase Inc. All rights reserved.|