• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Session Bean Identity

 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I read that All business object references of the same interface type for the same stateless session bean have the same object identity, which is assigned by the container

I didn't get clearly what does it mean identity here ? does it affect thread safety of the stateless session bean or what ?

 
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It means, that, if you compare two references for a business interface of a stateless session bean, equals() always returns true (in contrast to business interfaces of stateful session beans) - see core spec 3.4.5:

// Assume Test is a business interface of a SLSB
@EJB Test t1;
@EJB Test t2;
...
t1.equals(t2); // -> returns true

This reflects the fact that for a stateless session bean it doesn't matter which bean instance is used to process a business method invocation.
 
khaled Jamal
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ralph, I got it

 
Friends help you move. Good friends help you move bodies. This tiny ad will help:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic