Which Persistence is efficient. BMP or CMP

Discussions

Performance and scalability: Which Persistence is efficient. BMP or CMP

  1. Which Persistence is efficient. BMP or CMP (4 messages)

    I have some dobut about the performance of Bean managed and container managed persistence. Which will be more effiecient in terms of performance. If we consider coding point of view, Container managed is better. We need not to worry about the Persistence related coding.
    But in discussuion with one of my colleauge, it was highlighted that Bean managed will be better if we code the database related calls efficiently.
  2. If the database size is big enough then BMP is better. Also in BMP you more control over the system. you may want to use stored procedures instead of embedded SQL for database updated
    If you want entity beans to handle all its relationships then it is possible only with BMP ... and there is lot more intellegence that we can add to entity bean if it is BMP.
  3. If the database size is big enough then BMP is better. Also in BMP you have more control over the system. You may want to use stored procedures instead of embedded SQL for database updated
    If you want entity beans to handle all its relationships then it is possible only with BMP ... and there is lot more intellegence that we can add to entity bean if it is BMP.
  4. I think it depends a lot on your AppServer. There are several ways to have a better performance:

    - reuse prepared statements: this is hard to do in BMP, but your CMP engine should be able to do it.

    - use stored procedures: I'm not aware of any CMP engine that lets you do that, so BMP is the answer here.

    - avoid unnecessary stores: you can do that in BMP using dirty flags, but it requires more coding and is error-prone. Your CMP engine should be able to do that.

    - load the state in the finders: instead of going to the database in each ejbLoad method, the finder could load all the state from the DB at once. This is impossible in BMP, but your CMP engine should be able to do that. This can have a huge impact on performance, especially if your app often plays with lists of data.

    - only store the modified fields: you can do that in BMP, but it requires a lot of code, and is very error-prone. Your CMP engine should do that.

    IMO, CMP should be more efficient most of the time, if you have a good CMP engine, although it may have some limitations sometimes. I recommend having a look to Inprise AppServer to understand what a good CMP engine is.

    JB.
  5. We use CMPs just because it makes life(coding/debugginh) much easier. Later in the project we are going to identify CMPs that need to be BMPs with SQL, BMPs to stored procedures, or just SQL from our sessions. We think it is going to be hard to pin point performance bottle necks early in the project. If you need a good tool for generating CMPs from a SQL DB, go to this site: http://home.nycap.rr.com/hausam/EJBGen/EJBGen.html