Skip Headers

Oracle® Application Server Containers for J2EE Enterprise JavaBeans Developer's Guide
10g Release 2 (10.1.2)
Part No. B15505-01
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

Synchronizing Data during Bean Creation�

In 9.0.4.1, data is now automatically synchronized after the ejbPostCreate method. Previously, data was synchronized with an INSERT after the ejbCreate method. Then, if you added a CMR relationship in the ejbPostCreate method, an UPDATE was performed after the ejbPostCreate method. This resulted in two SQL statements. For performance reasons, the default is now to have a single SQL INSERT statement after the ejbPostCreate. If, however, you wish to have the old way of data synchronization, you can set the data-synchronization-option attribute, as follows:�

data-synchronization-option="ejbCreate"�

The default setting is as follows:�

data-synchronization-option="ejbPostCreate"�

If you have a foreign key as part of your primary key, you must set the data-synchronization-option to "ejbPostCreate" (or accept the default setting), as the foreign key has a non-null constraint. Since the primary key is set in the ejbCreate method and the foreign keys are initialized in the ejbPostCreate, all aspects of the primary key, including the foreign key, are initialized at the same time after the ejbPostCreate.