• Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB Handles

 
Chetan Sahasrabudhe
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Can anyone provide me the matrix for persisting EJB Handles

EJBObject Handle = What kind of beans (Stateless, Stateful, Entity, MDB)
EJBHome Handles = what kind of beans (Stateless, Stateful, entity, MDB)
 
Binoj Viswanathan
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
EJBObject Handle = Stateful
For stateless there is each time a method is invoked its a new request even if its from same client.So vats the use of EJBObject handle...?
For entity bean U hav better option with findByPrimaryKey..
MDBs .. no need to say


EJBHome Handles = Stateless, Stateful, entity
Home handles can b used for all except MDBs avoiding lookup ....


binoj v
 
Chetan Sahasrabudhe
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EJBObject Handle = Stateful
For stateless there is each time a method is invoked its a new request even if its from same client.So vats the use of EJBObject handle...?
For entity bean U hav better option with findByPrimaryKey..
MDBs .. no need to say


findByPrimaryKey is still a home method, and hence I will need to perform my JNDI Lookup for the same.

If i archive my EJBObject for entity bean, will it help me skip JNDI calls and later findByPrimaryKey call.
 
Binoj Viswanathan
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
its true.

So for entity beans the beter option is a archiv home handle and use findByPrimaryKey.(keep in mind that the bean wont cum out of pool ven its executing ejbFindByPrimaryKey)...U cn also use ejbObj handle. but in production env u may have other clients to ur "entity in DB" other than ur EntityBean.. so it cn throw NotSuchEntityException ven container calls ejbLoad or ejbStore for EntityBean instance......


binoj
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
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!