aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Local client view contract -doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Local client view contract -doubt" Watch "Local client view contract -doubt" New topic
Author

Local client view contract -doubt

Siva Masilamani
Ranch Hand

Joined: Sep 19, 2008
Posts: 385
Hi

I am preparing for SCBCD and was going through the specification.

I did not understand the point at the Local client view contract.

the Bean Provider must be careful that the state of one enterprise bean is not assigned as
the state of another. In general, the references that are passed across the local interface cannot be used
outside of the immediate call chain and must never be stored as part of the state of another enterprise
bean.


Could somebody please explain me what they are trying to tell at this point?.


I know that in case of local interface the object we passed is shared by both caller and callee...

But why we should not store the state of one ejb in to the state of other?

What do they mean by 'the references that are passed across the local interface cannot be used
outside of the immediate call chain " and which reference are they talking about?


SCJP 6,SCWCD 5,SCBCD 5

Failure is not an option.
Davide Crudo
Ranch Hand

Joined: Sep 08, 2009
Posts: 62
I believe you are referring to Stateless Session beans...right?

I was reading a while back that one of the differences between the local and remote interface is how to handle method calls.

For instance, in local interfaces, when you call a method passing another object as a parameter, you pass the reference of the object,
when you use remote interfaces, you pass the object as a value (i.e. a copy of the object)

Since Stateless beans are taken from the pool and then released, i think what they are trying to say, is that you should not take
the reference of the bean you are using and passing it to another object to use that reference later.

You can use it, however, during the immediate call chain, which i believe it means that you can use it, while the called method is running...
so, if you call a method, that call another method, you should be ok to pass to the second method, the reference of the stateless bean, but
this should last only for the current call. Subsequent calls should not refer to the previous Stateless bean...

This is just my interpretation...sometimes i find Specifications kind of cryptic ;)

Dave


SCJP, SCBCD
Siva Masilamani
Ranch Hand

Joined: Sep 19, 2008
Posts: 385
Yea...i got this point now..

thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Local client view contract -doubt