Persistence tab component properties

The Persistence tab allows you to specify an EJB entity Bean’s primary key and configure settings that allow EJB Server to save component state to a database server.

Table 6-2 summarizes the Persistence settings. See Chapter 8, “Managing Persistent Component State,” for detailed information on these fields.

Table 6-2: Persistence tab component properties

Field

Description

Persistence

Specifies whether component state is saved, and if so, how. The available options are:

  • None The default. The component’s state is not stored in a database.

  • Java Serialization For EJB stateful Session Beans only. The component implementation class is serialized and deserialized to save and restore component state.

  • Component Class Your component implementation manages persistence. Used for EJB entity Beans.

  • Automatic Persistent State EJB Server manages the persistent state of your component.

Primary Key

The primary key for EJB entity Beans. Specify the IDL type of the components primary key. For example: foo::bar::MyPK. Components with a primary key must have a findByPrimaryKey method in their home interface, and can have additional finder methods that allow clients to look up instances that match a desired primary key.

Unless you have defined an entity Bean by importing class or EJB-JAR files, you must define the primary key type yourself. For an EJB entity Bean, choose from the types listed in “Allowable primary key types”.

Storage Component

Specifies the name of a component that reads and writes component state information from a remote database server. Required when using automatic persistence, or when using component-managed persistence with an implementation that delegates to EJB Server’s built-in storage component.

Connection Cache

Specifies the connection cache used by the storage component. The cache must be installed on all servers where your component runs and allow by-name access.

Table

Specifies the name of the database table to store component state information. Create the table in the default database rather than in the dbname..table.

Time Out

This setting is reserved for future use.

Time Stamp

When using a mapped database table, specifies the timestamp used for optimistic concurrency control. Specify one of the following:

  • A column name The name of a column in the mapped table that is incremented in each update. By default, EJB Server uses 4-byte integer timestamp. You can also use a 16-byte binary value, but to do so, you must set the com.sybase.jaguar.component.ts.length property to binary(16).

  • “None” Enter “none” to disable optimistic concurrency control. This setting is not recommended.

  • No value If you leave the Time Stamp field blank, EJB Server uses all column values to perform optimistic concurrency control.

For best performance, use a 4-byte integer timestamp column. The timestamp column need not be mapped to the component’s persistent state fields. 16-byte binary timestamp values are not usable when other processes (besides EJB Server) update a table.