-
Feature Request
-
Resolution: Done
-
Major
-
JBossAS-4.0.0 Final
-
None
SourceForge Submitter: alvaromota .
I thing that is usual insert element 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.
For maximum flexibility, developers 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.
This is useful when we need to create a child entity
from inside the
ejbPostCreate method of a parent entity. The
foreign-key field on the
child??????s table will try to match an existing key on the
parent, but since it
has not been persisted, a violation error will occur.
To avoid that, and
still use the foreign-key constraint in the child??????s
table, we use the
"ejbCreate" or "commit" value on the tag in the parent
bean??????s descriptor.
Thanks
Alvaro Mota Gon??????alves