web server - Borland Technical Publications
web server - Borland Technical Publications web server - Borland Technical Publications
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
- Page 109 and 110: Application Client architecture Pac
- Page 111 and 112: Document Type Definitions (DTDs) my
- Page 113 and 114: Support of references and links The
- Page 115 and 116: Use of Manifest files Use of Manife
- Page 117 and 118: 106 BES Developer’s Guide
- Page 119 and 120: Sessions in secondary storage If yo
- Page 121 and 122: 110 BES Developer’s Guide
- Page 123 and 124: Container-managed persistence and R
- Page 125 and 126: Implementing an entity bean Generat
- Page 127 and 128: Container-Managed Persistence in Bo
- Page 129 and 130: Container-Managed Persistence in Bo
- Page 131 and 132: Setting Properties Setting Properti
- Page 133 and 134: Setting Properties into a BLOB. The
- Page 135 and 136: Setting Properties Automatic table
- Page 137 and 138: 126 BES Developer’s Guide
- Page 139 and 140: Container-managed persistence and R
- Page 141 and 142: Container-Managed Persistence in Bo
- Page 143 and 144: Container-Managed Persistence in Bo
- Page 145 and 146: Container-Managed Persistence in Bo
- Page 147 and 148: Container-Managed Persistence in Bo
- Page 149 and 150: Container-Managed Persistence in Bo
- Page 151 and 152: Container-Managed Persistence in Bo
- Page 153 and 154: 142 BES Developer’s Guide
- Page 155 and 156: Setting Properties J2EE 1.3 Entity
- Page 157 and 158: Setting Properties Figure 16.2 Edit
- Page 159: Setting Properties Table 16.1 ejb.m
- Page 163 and 164: Setting Properties Security Propert
- Page 165 and 166: Aggregate Functions in EJB-QL Selec
- Page 167 and 168: Support for ORDER BY Support for OR
- Page 169 and 170: Overriding SQL generated from EJB-Q
- Page 171 and 172: Container-managed data access suppo
- Page 173 and 174: 162 BES Developer’s Guide
- Page 175 and 176: Generating primary keys from a cust
- Page 177 and 178: Implementing primary key generation
- Page 179 and 180: Transaction manager services Consis
- Page 181 and 182: Transaction manager services When t
- Page 183 and 184: Transaction manager services Follow
- Page 185 and 186: Declarative transaction management
- Page 187 and 188: Declarative transaction management
- Page 189 and 190: JDBC API Modifications JDBC API Mod
- Page 191 and 192: Handling of EJB exceptions Applicat
- Page 193 and 194: 182 BES Developer’s Guide
- Page 195 and 196: Client View of an MDB Client View o
- Page 197 and 198: Clustering of MDBs This is yet anot
- Page 199 and 200: Error Recovery Redelivered messages
- Page 201 and 202: 190 BES Developer’s Guide
- Page 203 and 204: JNDI Definitions Module Important s
- Page 205 and 206: Disabling and Enabling a Deployed D
- Page 207 and 208: Configuring JDBC Datasources In the
- Page 209 and 210: Configuring JDBC Datasources To add
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