Chandra kumar wrote:
> Section 10.5.2 of EJB 2.0 spec states the following:-
>
> "....... The entity Bean Provider must not attempt to modify the values of
>cmr-fields in an ejbCreate<METHOD(...) method; this should be done in the
>ejbPostCreate<METHOD(...) method instead. ......"
>
> I've tried my best to understand the above. But I could not succeed.
> Here are my questions (note: when we have strict DB constraints in place):
>
> 1. How the above statement holds good, if we want set the relationship value in
>child's ejbPostCreate(), If DB insert is issued after ejbCreate().
That's up to the CMP implementation. Sybase EAServer (by default) will do
an 'insert' after ejbCreate and will do an 'update' after ejbPostCreate
(of course if no fields have changed, the 'update' can be skipped).
> 2. Let's say if DB insert is deferred to end of ejbPostCreate(), then we cannot
>create child object(s) in ejbPostCreate() of Parent.
That depends on whether your database schema has foreign key constraints that
will break if the insert is deferred.
> If this is something very obvious, it'd probably irritate some to see a long mail
>with examples. So I defer that to you.
>
> Any help would be greatly appreciated.
>
> Thanks for time and consideration,
> Chandra
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>
>
>
>
--
_______________________________________________________________________________
Evan Ireland Sybase EAServer Engineering [EMAIL PROTECTED]
Wellington, New Zealand +64 4 934-5856
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".