Win a copy of OCP Oracle Certified Professional Java SE 11 Developer Practice Tests this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
Sheriffs:
  • Devaka Cooray
  • paul wheaton
  • Mark Herschberg
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
  • Jj Roberts
Bartenders:
  • Carey Brown
  • salvin francis
  • Piet Souris

Return value of ejbCreate()

 
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it mandatory that the ejbCreate() method of a CMP entity bean must return only null and not the actual PK value?

I verified this in webshpere and the verifier did not complain when I returned the actual primary key value in the ejbCreate() method.

What does the spec say about this? Can someone pls throw some light on this?
[ February 15, 2005: Message edited by: Keerthi P ]
 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
i think the varifier wont check this since the PK which u r returning may actually pointing 2 a null reference.(i'm not sure abt this).But the deployment tool will (shud) check this.EJB Spec mandates this as to allow BMP bean to subclass an CMP bean.(in BMP U must retrun PK from UR ejbCreate()). In cmp PK will b set onli after the ejbCreate() returns and b4 ejbPostCreate(...) is invoked.

thanx
binoj
 
Keerthi P
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The verifier/deployment tool can only check the return type but NOT the return 'value' of ejbCreate() because the return value is unknown until runtime. The verifier can only do a 'static' check on the EJBs.
[ February 16, 2005: Message edited by: Keerthi P ]
 
Binoj Viswanathan
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
>>>>>>verifier/deployment tool can only check the return type but NOT the >>>>>>return 'value' of ejbCreate() because the return value is unknown >>>>>>until runtime.

Ya. U R Right..

It is mandatory that the ejbCreate() method of a CMP entity bean must return only null and not the actual PK value, as per the spec.


binoj V
 
mooooooo ..... tiny ad ....
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic