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

CMR field doubt

 
Saurabh Chaubey
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The entity Bean Provider MUST NOT attempt to modify the values of cmr-fields in an ejbCreate<METHOD>(...) method. This should be done in the ejbPostCreate<METHOD>(...) method instead.


What is the reason behind for the above statement to be true?

Thanks in Advance!!
 
Gowher Naik
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In ejbCreate the container creates table in DB by using primary key provided by bean developer.In ejbCreate you cannot perform any activity related to relationship this should be done in ejbPostCreate.
Before table creation and primary key creation how can anyone perform activity related to relationship.That is why activity related to relationship should be done after completion of ejbCreate.
 
Aakash Parashar
Ranch Hand
Posts: 123
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adding more info
EJBObject is created after ejbCreate<> and before ejbPostCreate<> and primary key is also available after ejbCreate<>, so relation operations can be done only after ejbCreate<>
Thnks.
[ August 30, 2007: Message edited by: Neo Greet ]
 
Saurabh Chaubey
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot for the explanation.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic