The behaviour that you have described is illegal, since ejbStore
should have been called by the container between ejbPostCreate and ejbLoad
to ensure that the state of the instance was properly synchronized with the
database.

fname lname wrote:

> The EJB 1.1 server I'm using is doing something I
> don't like and I'd like to find out how other vendors
> are handling this situation.  Your comments will be
> greatly appreciated.
>
> Both Entity A and Entity B have transaction attribute
> set to required.
>          [-----EJB Container-----]
> client     Entity A     Entity B
>   |            |            |
>   |***********>|            |
>   |         [create]        |
>   |       [postCreate]*****>|
>   |            |            |
>   |            |<**callBack*|
>   |            |            |
>
> 1) The client calls create on Entity A
> 2) Entity A ejbCreate executes
> 3) Entity A postCreate modifies its state and passes
> a reference to itself to Entity B like so:
>                 this.field1 = "Hello";
>                 B b = bHome.findByPrimaryKey("1");
>                 b.passA( myRemote );
> 4) Entity B calls a method on A using the reference it
> was passed.
> THIS IS THE PART I DON'T LIKE--> just before B calls
> back on A, ejbLoad is getting called on A, having the
> affect of losing the modifications within A up until
> that point.
>
> A trace of the lifecycle methods is shown below:
>         AImpl.setEntityContext
>         AImpl.ejbCreate
>         AImpl.ejbPostCreate
>         BImpl.setEntityContext
>         BImpl.ejbCreate
>         BImpl.ejbPostCreate
>         BImpl.passA
>         AImpl.ejbLoad CALLED ON MODIFIED ENTITY!!
>         AImpl.callBack
>         AImpl.ejbStore
>         AImpl.setEntityContext
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Tax Center - online filing with TurboTax
> http://taxes.yahoo.com/
>
> ===========================================================================
> 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".

Reply via email to