Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Local client view contract -doubt

 
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Siva Masilamani
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yea...i got this point now..

thanks.
 
    Bookmark Topic Watch Topic
  • New Topic