Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Are EJBHome and EJBObject pooled?

 
Deeps Soma
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are EJBHome and EJBObject pooled?
I am assuming they would be, but different containers use different schemes.

I would appreciate any clarification on this.

thanks.
 
LazyCoder
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ya ur right depending on container policies there may be any number of home and remote interfaces
 
Ramakrishnan thiyagarajan
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
EJBHome is EJBclient can use to create ,find destroy methods and EJBObject is container generated implemented object.actually both are pooled
it is container specific.
 
Deeps Soma
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your replies Karthik and Ramakrishnan.
 
s pramod
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Well i would like to add to the question posted by Deepa.
So does it make any sense to call remove method on stateless session beans?
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So does it make any sense to call remove method on stateless session beans


You dont need to call remove method for SLSB.
 
Alexandru Popescu
Ranch Hand
Posts: 995
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As you can read in the EJB 2.1 spec about the session objects lifecycles (Chapter 6.7): a remove method will take the session from "exists and referenced" state and move it to "does not exist and referenced" state (so preparing it to return to the pool).
Another interesting part of ejbRemove() is that it is responsible with the deallocation of all resources allocated during the ejbCreate() invocation.
 
s pramod
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks ali but This is what happens inside the ejbremove method in StatelessEJLocalObject(weblogic)

public void remove(MethodDescriptor methoddescriptor)
throws EJBException, RemoveException
{
if(!methoddescriptor.checkMethodPermissionsLocal(EJBContextHandler.EMPTY))
{
SecurityException securityexception = new SecurityException("Security violation: insufficient permission to access method");
throw new AccessLocalException(securityexception.getMessage(), securityexception);
} else
{
return;
}
}
i.e the remove method call is a noop.

And the spec as you pointed says the remove method changes the state of session object from exists and referenced to does not exist and referenced.
So can u please throw some light on the same.
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess there is a different meaning for *removing* in SLSB.

When the client calls remove() with SLSB, the container will simply put it *back* into the pool without really destroy it.

For SFSB, the bean instance will be removed, without putting back into the bean pool.

This property is valid for Entity bean too.

You call remove simply means you tell the container you are finished with this SLSB, whether this SLSB be deleted is all depends on the container. If it has enough resource, it may keep it. Otherwise, it may distroy it. Thus, we can control the *real* deletion.

Nick
 
He loves you so much! And I'm baking the cake! I'm going to put this tiny ad in the cake:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!