File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB Handles

 
Chetan Sahasrabudhe
Ranch Hand
Posts: 75
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic