• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Return value of ejbCreate()

 
Keerthi P
Ranch Hand
Posts: 203
  • 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 ]
 
Binoj Viswanathan
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: 203
  • 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