This week's book giveaway is in the Java 9 forum.
We're giving away four copies of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications and have Sander Mak & Paul Bakker on-line!
See this thread for details.
Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

ejbActiuvate in CMP entity beans  RSS feed

 
sid nagol
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
this question is about CMP entity beans ejbActivate method.
the bean can go from pooled state to method ready state in two ways.

1) ejbCreate, ejbPostCreate,
2) ejbActivate.

my question is what if it goes through ejbActivatre?
in that case, ejbCreate, ejbPostCreate will not be called.

so does ejbActivate should set the cmp, cmr fields
(the whole question is about CMP entity beans only)

thanks
sid
 
sawan parihar
Ranch Hand
Posts: 250
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my question is what if it goes through ejbActivatre?
in that case, ejbCreate, ejbPostCreate will not be called


Yes ejbCreate, ejbPostCreate will not be called in the above case.

ejbCreate, ejbPostCreate will be called when you are creating the entity bean whereas ejbActivate() is called to activate the entity bean that is already created.

so does ejbActivate should set the cmp, cmr fields


No. As the bean is already created there is no need to set the values.
 
sid nagol
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi sawan
thanks for the answer and time
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!