user manual
156 BES Developer’s Guide
Container-Managed Persistence in Borland Enterprise Server
(You will need to handle these rollbacks appropriately.) Otherwise, the
transaction commits. Again using the same table, the CMP engine generates
the following SQL using the VerifyModifiedFields behavior if only VALUE1 was
updated:
UPDATE MyTable SET (VALUE1 = value1) WHERE KEY = key AND VALUE1 = old-
VALUE1
VerifyAllFields
This option is very similar to VerifyModifiedFields, except that all fields are
verified. Again using the same table, the CMP engine generates the following
SQL using this option:
UPDATE MyTable SET (VALUE1 = value1) WHERE KEY = key AND VALUE1 = old-
VALUE1 AND VALUE2 = old-VALUE2
Note The two verify settings can be used to replicate the SERIALIZABLE isolation level
in the Container. Often your applications require serializable isolation
semantics. However, asking the database to implement this can have a
significant performance impact. Using the verify settings allows the CMP
engine to implement optimistic concurrency using field-level locking. The
smaller the granularity of the locking, the better the concurrency.
Persistence Schema
The Borland CMP 2.0 engine can create the underlying database schema
based on the structure of your entity beans and the information provided in the
entity bean deployment descriptors. You don't need to provide any CMP
mapping information in such cases. Simply follow the instructions for
"Specifying tables and datasources," below. Or, the CMP engine can adapt to
an existing underlying database schema. Doing so, however, requires you to
provide information to the CMP engine about your database schema. In such
cases, you should refer to “Basic Mapping of CMP fields to columns” on
page 158, below, as well as CASE 2 in "Specifying tables and datasources."
Specifying tables and datasources
The minimum information required in ejb-borland.xml is an entity bean name
and an associated datasource. A datasource is a class used to obtain
connections to a database, JMS implementation, or backing store of some
other type. Information on datasource configuration is in Chapter 21,
“Connecting to Resources with BES: using the Definitions Archive (DAR)”.
There are two means of providing this information.
CASE 1: A development environment without existing database tables using
either JDataStore or Cloudscape databases.
In this case, the Borland CMP engine creates tables automatically, assuming
that the entity bean name is the same as the desired table name. You need
only provide the bean's name and its associated datasource as a property:










