File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes BMP entity bean - create Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "BMP entity bean - create" Watch "BMP entity bean - create" New topic

BMP entity bean - create

Ranganathan Kaliyur Mannar

Joined: Oct 16, 2003
Posts: 1101

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 :


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


James Turner
Ranch Hand

Joined: May 10, 2004
Posts: 194
I would imagine that anything changed during an ejbPostCreate would be sync'ed up at the database with the ejbStore call.

James<br />SCJP 1.4 - 92%<br />SCJD - 93%<br />SCWCD 1.4 - 95%<br />SCBCD 1.3 - 100%<br />SCEA - 92%
raghu vadranam

Joined: Sep 01, 2004
Posts: 23
Container can call any time ejbStore and ejbLoad methods.
Hope this will help.

Raghu Nadh<br />SCJP 1.2,SCBCD
Rahul Devgan

Joined: Aug 04, 2004
Posts: 24
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.

Rahul Devgan<br />SCJP<br />--- one must be willing to let go of small pleasures in life to achieve greater things ---
Ranganathan Kaliyur Mannar

Joined: Oct 16, 2003
Posts: 1101

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?

I agree. Here's the link:
subject: BMP entity bean - create
It's not a secret anymore!