Hi Aamir, Regarding your doubt about BMP and CMP I hope this helps you: 1.)Bean Managed Persistence is selected under cases where the complexity of queries with the backend is more where you would like to handle the JDBC/SQL operations on your own. 2.)Container Managed Persistence is used when we go for simple lookup operations in database. Thus in BMP its you who will have to manage everything but in CMP its as follows: The CMP entity beans allows the container to handle some or all of its data access logic.Rather than coding JDBC/SQL operations in your bean class ,your container implicitly performs all database operations behind the scenes. With CMP ,you must make some of your entity bean class's fields public so that the container can set the fields when it performs database operations on behalf of your bean. Thus CMP handles everything on your behalf(such as Transaction Management,Database connection pooling,security etc,). Well its vast to explain this ...but hope this gives you some idea and if any more info you are always welcomed. Rgds, Poornima.
Thanks for your reply Poornima, need a little more explanation. With CMP ,we can only do the simple db queries like insert, delet etc or can also do something like stored procedures? How the container will know that we are using CMP or BMP? (we have to explain this in deployment descripter I think, am I right?) Thanks again Aamir
Amir, Hope, the following explanation would clarify some of your questions. First, you are right when you said that you specify in deployment descripter whether the bean is a CMP or BMP. Deploying, and the usasge of CMP is verymuch tied to the vendor of the Container. I am not aware of any Application servers that support Stored Procedures for CMP beans.
Ew. You guys are ugly with a capital UG. Here, maybe this tiny ad can help: