• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

can some one explain

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have this excerpt from the EJB spec 2.0
Can some one explain me what is the difference.
Regards
steve
65 8/14/01
6.9.1 Stateful session beans
A stateful session object has a unique identity that is assigned by the container at create time.
A remote client can determine if two remote object references refer to the same session object by invoking
the isIdentical(EJBObject otherEJBObject) method on one of the references. A local
client can determine if two local object references refer to the same session object by invoking the
isIdentical(EJBLocalObject otherEJBLocalObject) method.
Client View of a Session Bean Enterprise JavaBeans 2.0, Final Release Object identity
Sun Microsystems, Inc.
The following example illustrates the use of the isIdentical method for a stateful session object.
FooHome fooHome = ...; // obtain home of a stateful session bean
Foo foo1 = fooHome.create(...);
Foo foo2 = fooHome.create(...);
if (foo1.isIdentical(foo1)) {// this test must return true
...
}
if (foo1.isIdentical(foo2)) {// this test must return false
...
}
6.9.2 Stateless session beans
All session objects of the same stateless session bean within the same home have the same object identity,
which is assigned by the container. If a stateless session bean is deployed multiple times (each
deployment results in the creation of a distinct home), session objects from different homes will have a
different identity.
The isIdentical(EJBObject otherEJBObject) and isIdentical(EJBLocalObject
otherEJBLocalObject) methods always returns true when used to compare object references
of two session objects of the same stateless session bean.
The following example illustrates the use of the isIdentical method for a stateless session object.
FooHome fooHome = ...; // obtain home of a stateless session bean
Foo foo1 = fooHome.create();
Foo foo2 = fooHome.create();
if (foo1.isIdentical(foo1)) {// this test returns true
...
}
if (foo1.isIdentical(foo2)) {// this test returns true
...
}
 
Ranch Hand
Posts: 8946
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It tells that there is no difference between the instances of stateless session bean.
 
Ruth Stout was famous for gardening naked. Just like this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic