File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can some one explain

 
Steve Agarwal
Ranch Hand
Posts: 51
  • 0
  • Mark post as helpful
  • send pies
  • 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
...
}
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It tells that there is no difference between the instances of stateless session bean.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic