web server - Borland Technical Publications

web server - Borland Technical Publications web server - Borland Technical Publications

techpubs.borland.com
from techpubs.borland.com More from this publisher
12.11.2014 Views

Setting Properties Table 16.2 Property Type Default Description ejb.datasource java.lang.String N/A Default JDBC datasource to use in case no table-properties have been set. CMP 2.x only. ejb.truncateTableNa me Table Properties Entity properties for CMP 2.x (continued) java.lang.Boolean False If no table name is specified, CMP2.x engine will use the EJB name as the table name. EJB names can be more than 30 characters in length. Moreover, certain databases have a restriction on the table length to be 30 characters or less. This property is used to force the table name to be truncated to be 30 characters or less. CMP 2.x only. ejb.eagerLoad java.lang.Boolean False eager-loads the entire row and keeps the data in the transactional cache. After loading, all database resources are released. Subsequent getters could get data in cache and not having to require any more database resources. CMP 2.x only. The following properties apply to CMP 2.x only. If you are migrating from CMP 1.1 to CMP 2.x, you must update your CMP properties. CMP 1.1 properties were formerly of the format ejb., and were all specified in the portion of the deployment descriptor. With CMP 2.x, BES adds Table and Column Properties, which manage persistence. Refer to these properties below to see where migration issues may appear. Chapter 16: Using BES Properties for CMP 2.x 149

Setting Properties Table 16.3 Table properties Property Type Default Description datasource java.lang.String None JNDI datasource name of the database for this table. optimisticConcu rrencyBehavior useGetGenerated Keys primaryKeyGener ationListener dbcAccesserFact ory getPrimaryKeyBe foreInsertSql getPrimaryKeyAf terInsertSql java.lang.String UpdateMo difiedFi elds The container uses optimistic or pessimistic concurrency to control multiple transactions (updates) that access shared tables. Acceptable values are: ■ SelectForUpdate: database locks the row until the current transaction is committed or rolled back. Other selects on the row are blocked (wait) until then. ■ SelectForUpdateNoWAIT: database locks the row until the current transaction is committed or rolled back. Other selects on the row will fail. ■ UpdateAllFields: perform an update on all of an entity's fields, regardless if they were modified or not. ■ UpdateModifiedFields: perform an update only on fields known to have been modified prior to the update being issued. ■ VerifyModifiedFields: verify the entity's modified fields against the database prior to update. ■ VerifyAllFields: verify all the entity's fields against the database prior to update regardless if they were modified or not. Pessimistic concurrency specifies the container to allow only one transaction at a time to access the entity bean. Other transactions that try to access the same data will block (wait) until the first transaction completes. This is achieved by issuing a tuned SQL with FOR UPDATE when the entity bean is loaded. To achieve pessimistic concurrency set SelectForUpdate or SelectForUpdateNoWAIT. java.lang.Boolean False Whether to use the JDBC3 java.sql.Statement.getGeneratedKeys() method to populate the primary key from autoincrement/sequence SQL fields. Currently, only Borland JDataStore supports this statement. java.lang.String None Specifies a class, written by the user, that implements com.borland.ejb.pm.PrimaryKeyGenerationList ener interface and generates primary keys. java.lang.String None A factory class that can provide accessor class implementations to get values from a java.sql.ResultSet, and set values for a java.sql.PreparedStatement. java.lang.String None SQL statement to execute before inserting a row to provide primary key column names. java.lang.String None SQL statement to execute after inserting a row to provide primary key column names. 150 BES Developer’s Guide

Setting Properties<br />

Table 16.3<br />

Table properties<br />

Property Type Default Description<br />

datasource java.lang.String None JNDI datasource name of the database for<br />

this table.<br />

optimisticConcu<br />

rrencyBehavior<br />

useGetGenerated<br />

Keys<br />

primaryKeyGener<br />

ationListener<br />

dbcAccesserFact<br />

ory<br />

getPrimaryKeyBe<br />

foreInsertSql<br />

getPrimaryKeyAf<br />

terInsertSql<br />

java.lang.String<br />

UpdateMo<br />

difiedFi<br />

elds<br />

The container uses optimistic or pessimistic<br />

concurrency to control multiple transactions<br />

(updates) that access shared tables.<br />

Acceptable values are:<br />

■ SelectForUpdate: database locks the row<br />

until the current transaction is<br />

committed or rolled back. Other selects<br />

on the row are blocked (wait) until then.<br />

■ SelectForUpdateNoWAIT: database locks<br />

the row until the current transaction is<br />

committed or rolled back. Other selects<br />

on the row will fail.<br />

■ UpdateAllFields: perform an update on<br />

all of an entity's fields, regardless if they<br />

were modified or not.<br />

■ UpdateModifiedFields: perform an update<br />

only on fields known to have been<br />

modified prior to the update being<br />

issued.<br />

■ VerifyModifiedFields: verify the entity's<br />

modified fields against the database<br />

prior to update.<br />

■ VerifyAllFields: verify all the entity's<br />

fields against the database prior to<br />

update regardless if they were modified<br />

or not.<br />

Pessimistic concurrency specifies the<br />

container to allow only one transaction at a<br />

time to access the entity bean. Other<br />

transactions that try to access the same<br />

data will block (wait) until the first<br />

transaction completes. This is achieved by<br />

issuing a tuned SQL with FOR UPDATE when<br />

the entity bean is loaded. To achieve<br />

pessimistic concurrency set SelectForUpdate<br />

or SelectForUpdateNoWAIT.<br />

java.lang.Boolean False Whether to use the JDBC3<br />

java.sql.Statement.getGeneratedKeys()<br />

method to populate the primary key from<br />

autoincrement/sequence SQL fields.<br />

Currently, only <strong>Borland</strong> JDataStore<br />

supports this statement.<br />

java.lang.String None Specifies a class, written by the user, that<br />

implements<br />

com.borland.ejb.pm.PrimaryKeyGenerationList<br />

ener interface and generates primary keys.<br />

java.lang.String None A factory class that can provide accessor<br />

class implementations to get values from a<br />

java.sql.ResultSet, and set values for a<br />

java.sql.PreparedStatement.<br />

java.lang.String None SQL statement to execute before inserting<br />

a row to provide primary key column<br />

names.<br />

java.lang.String None SQL statement to execute after inserting a<br />

row to provide primary key column names.<br />

150 BES Developer’s Guide

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!