one more question about javacoding mock exam.....
What considerations make sense when writing an entity bean?
a) Use BMP when storing standard datatypes and performance is essential (CORRECT) ???
b) Use BMP when storing standard datatypes and performance is not essential
c) Use BMP when storing complex datatypes and performance is essential (ANSWERED) (CORRECT)
d) Use BMP when storing complex datatypes and performance is not essential (ANSWERED) (CORRECT)
BMP can easily be used to store complex datatypes (in contrast to CMP), it's performance depends partially on the bean programmer's work
Well, every article that I read on internet said CMP improve performance using cache and another features implemented by the container.
The articles said programmers have to be dba's to create betters queries than the container...
I agree with the problems about complex types, but performance .....
Whereas BMP, the SQL are hand-crafted and you can use a very specialise SQL query that probably will squeeze every ounce of the performance for that DBMS that you have chosen.
Note a normally there is a slight advantage of BMP over CMP in term of performance, but when you consider that there is alot of usage of that EJB,
then these performance really adds up.
So if it is performance that you need, normally the advise would be to use BMP.
look at this site:
but the exam cover EJB 1.1 .... so...
I think Lim is correct.
I agree to you. BMP is faster or CMP is faster??? confusing....
Use CMP instead of BMP
Before introduction of EJB2.0 specification often developers used BMP rather than CMP because the previous EJB spec does not support enough important features like relationships. But EJB2.0 spec for CMP has good relationship support as well as performance improvements.
One of the CMP performance improvement technique in EJB2.0 is that the Container can monitor bean's data (in-memory buffer) change and if any changes happens in that data then only Container will update the database. Because of this monitoring capability, CMP gives better performance than BMP. And another technique is when you call finder method in BMP, it initially retrieves primary key with first call to the database and then instance data by placing a second call to the database. It makes two calls to the database. But CMP gets the data with single call to the database for the finder methods. Thus CMP gives better performance than BMP because Container has good hold on CMP.