Chapter 8 Creating J2EE Applications for BEA WebLogic
The delay-database-insert-until element is used to specify the precise time at which a new bean that uses RDBMS CMP is inserted into the database. By default, the database insert is done after ejbPostCreate.
Delaying the database insert until after ejbPostCreate is required when a cmr-field is mapped to a foreign-key column that does not allow null values. In this case, the cmr-field must be set to a non-null value in ejbPostCreate before the bean is inserted into the database.
Note that the cmr-fields may not be set during ejbCreate, before the primary key of the bean is known.
It is also generally advisable to delay the database insert until after ejbPostCreate if the ejbPostCreate method modifies the persistent fields of the bean. This can yield better performance by avoiding an unnecessary store operation.
For maximum flexibility, you should avoid creating related beans in their ejbPostCreate method. This may make delaying the database insert impossible if database constraints prevent related beans from referring to a bean that has not yet been created. Allowed values: ejbCreate - perform database insert immediately after ejbCreate ejbPostCreate - perform insert immediately after ejbPostCreate (default).
Used in: weblogic-rdbms-bean Example:
<delay-database-insert-until>ejbPostCreate</delay-database-insert-until> --> <!ELEMENT delay-database-insert-until (#PCDATA)>
Copyright (C) 2005. Sybase Inc. All rights reserved. |
![]() |