• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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
 
reply
    Bookmark Topic Watch Topic
  • New Topic