To use automatic persistence, you must define a state datatype to hold your component’s instance state, implement accessor methods, and choose a storage component.
Configuring a stateful component to use automatic persistence
Display the component’s properties, then click the Persistence tab. Configure the Persistence/General tab settings as follows:
Setting |
Value |
---|---|
Persistence |
Choose Automatic Persistent State. |
State |
Enter the name of an IDL structure that contains your component’s state data, for example: TheCart::CartState “Defining the IDL state type” describes how to create this structure. |
State methods |
Enter the names of the component methods
that retrieve and apply an instance’s state data. If you specify
no value, the default is |
Storage component |
Specify the name of the storage component, as described in “Storage components”. |
Connection cache |
If using database storage, enter the name of a JDBC connection cache that connects to the database. The cache must have by-name access enabled. |
Table |
If using database storage, enter the name of a database table where the serialized data is to be stored. If you use Sybase Adaptive Server Enterprise or Adaptive Server Anywhere, EAServer creates the table if it does not exist. When using another data server, you or your database administrator (DBA) must create the table manually. The table must have the schema described in “Table schema for binary storage”. |
Define the IDL state type as described below.
Add code to retrieve, apply, and modify the state data as described below.
Regenerate stubs and skeletons for the component—this step will generate the Java classes for the IDL state types.
If using in-memory storage, configure the component’s Mirror Cache properties and cluster to support in-memory failover, as described in “Requirements for in-memory stateful failover”.
Copyright © 2005. Sybase Inc. All rights reserved. |