• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

BMP entity bean - create

 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1103
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I am testing a BMP entity bean on JBoss. As we all know, in a BMP entity bean, we write "insert" statement in ejbCreate and "update" statement in ejbStore. When I test the bean by creating a record, the following sequence is shown :

1.setEntityContext
2.ejbCreate
3.ejbPostcreate
4.ejbStore

The first 3 steps are ok. But why is ejbStore called during create? or is it implementation specific?

Thanks,
Ranga.
 
James Turner
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would imagine that anything changed during an ejbPostCreate would be sync'ed up at the database with the ejbStore call.
 
raghu vadranam
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Container can call any time ejbStore and ejbLoad methods.
Hope this will help.
 
Rahul Devgan
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you writing update in ejbStore? Why not create a bizmethod of your own for the same and call update from there and then container can call ejbStore/ejbLoad as its own wish or fancies and you are not affected by the same.
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1103
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am developing a BMP bean for the first time. And in the book, it was shown to write updated statements in ejbStore method. For BMP, I think that would be the right way. Even otherwise, let's say I write a CMP. So, even in CMP, will ejbStore be called during create?

or will ejbStore be defenitely called during create? can I rely on that part?

Thanks,
Ranga.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic