Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

when it will get executed?

 
Suhas Madap
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
May I know, when the ejbCreate() method will get executed? Can we pass arguments to the ejbCreate()? If so for which session bean, we should do that? please explain this some pratical scenario.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34386
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Suhas Madap:
Hi,
May I know, when the ejbCreate() method will get executed?

ejbCreate() is called behind the scenes when the client calls create() on your EJB's home interface.

Can we pass arguments to the ejbCreate()?

Yes. You can write your own ejbCreate methods and then those signatures are valid.

If so for which session bean, we should do that? please explain this some pratical scenario.

This is more frequently done for entity beans than session beans. You could use it for stateless session beans though - if you wanted to pass some initialization information.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic