• 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Return value of ejbCreate()  RSS feed

 
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
  • 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
  • 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: 204
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!