Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Totally Confused about ejbCreate()

 
Amit Batra
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you write the ejbCreate() in you bean class, does it or does it not have to also throw the CreateException??. From the HFEJB I get the sense that its optional, The SCBCD manning book says its a must and so does the Whizlab simulator.
 
prashanth kumar
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its optional in bean class.
It follows normal java interface rule.If must declare it in your class only if you are throwing it inside the ejbCreate() explicitly.

HTH
Prashanth
 
Prabhu Venkatachalam
Ranch Hand
Posts: 502
Java jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
CreateException is useful with enity beans to say client that entity creation in persistence store failed.

Refer API documentaion, it clearly states the use of CreateException.

Though it is optional as because ejbCreate() is left to developer to write in their own way, it is better to put CreateException.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic