Sorry if this has already already discussed. In that case, can you point
me to such
discussion? (for example, EJB-interest XX/Aug/98 or similar).

In EJB spec, section 9.4.1 (about method ejbPostCreate) we read:

   The EJB object identity is available during the ejbPostCreate()
method.
   The instance may, for example, pass its own EJB object reference to
another
   EJB object as a method argument.

Let me see if I have well understood that?
Consider 3 cases depending who am I giving that reference to:
   1) a client
         How did this EJB got the reference to a client? Is that
possible?
         I remember to have used callbacks to client in CORBA but I have

         not seen much of that yet in EJB.
   2) another EJB object
         I would expect such an object being another client of "this
EJB".
         In that case, it should be able to obtain a reference to "this
object"
         through JNDI and the home interface as any other client would.
         However, let us suppose that it is possible and I write:
             otherEJB.takeThisRef(this)
         Then otherEJB keeps myRef in a variable called you and
eventually
         does, for example:
             you.yourBusinessMethod()
         In that case, the container has no control over that call so it
cannot
         control the transaction in which that method will run.
         And what if that object does something like
             you.ejbPostCreate()     // without any previous
ejbCreate,...
             you.ejbPassivate()       // Uumm!
             etc.
          Also, "otherEJB" (or its class) would be using the type of
"thisObject",
          say "ThisBean" as it has a method with signature
                public void takeThisRef (ThisBean beanRef)
  3) another Java object
          All the previous comments apply.
          Is there anything new to consider here? I can think for
example that
          a method in such object does not even run in a transaction
(managed
          by the container). I don't know if there would be further
implications
          with this....<<too much?? I am not on firm land here!>>

I would be interested in how useful it may be something like that.
What was the spirit of the EJB spec when that paragraph was written.
Am I missing something here. Isn't it "this" what is passed in a
parameter.
In that case, what would it be? I would expect at least that it is not
the actual
bean implementation but the class created by the container that
implements
the remote interface and intercepts all the business method calls.
In that case, the class of "otherEJB" would not know about ThisBean but
about the Remote Interface of ThisBean, (usually called "This" like
"Customer"
for "CustomerBean", "Car" for "CarBean", etc).

Thank you for your time. Please, let me know clearly if anything I said
before
did not make sense at all so I can learn a bit quicker about all this.

Javier Deniz

===========================================================================
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