CMP and BMP in application

I am new to EJB, please help me on this:
Can i have mix of CMP and BMP in my application?
Is it best enforce that all entity bean in either one but not both?

You are impling that BMP is DB-dependent. The SQL generated by the >Container is nothing magical. It is no more DB independent than SQL >written by the developer. You don't have to be DB-specific to use BMP, >but you do have to be appserver-specific to use CMP.By Db independent I mean that the sql code for container call back methods is generated by Container. You dont have to do anything. If you are deploying bean for oracle or sql , container will take care for that. Refer to the specs There is brief para on advantages of CMP.
For BMP you have to change the code according to the database. Container will not do anything for that.
"2. Reduced development efforts."
Yes, marginally, but the reduction in initial development time must >be weighed against:
The tools (or lack thereof) provided to map the beans to the tablesWell even if you are working with BMP you have to be aware of that. There are various performance improvement setting which are app server specific. It doesnt matter if you are using BMP or CMP for that matter
The time spent dealing with appserver vendors when things don't workOfcourse this happens with BMP also.
The inherent limited flexibility of CMPAlmost 90 % of the scenarios can be delt with CMP. Yes if not you can use BMP.
Also if time is such a factor, you should probably be generating your >beans (either CMP or BMP). This eliminates the development effort >difference between them. Of course that means developing BMP will be >faster since you don't have to muck about with the appserver, mapping >beans, marking methods as read-only, etc.Ha... I cannot take it. In general I can say It doesnt matter if you are using BMP or CMP , you have to be aware of different performance and other settings which are app server specific.
Remember CMP is available for 2 reasons:
1) So you can minimize development effort on simple Object-to-RDB >mappingsThey now support various relationships like 1-1,1-many, many-many
2) So that the big vendors (IBM, BEA, etc.) who were involved in >drafting the spec can provide "features" not in the specification, >encouraging vendor lock-in. Any Specification is not complet or exaustive. Vendors need to fill the gap.
--Ashwani

Similar Messages

  • CMP and BMP configure for deploying in weblogic

    how to run CMP and BMP in weblogic and configure in welogic
    tell me the steps to be followed for connection pooling and deployement and configure in weblogic builder....

    Disagree that CMP is always better than BMP. CMP is in reality merely an implementation of BMP that provides a declarative method of providing a persistence layer. You could easily use other declarative systems to provide the same service, but you are alway relying on BMP and when CMP fails to provide you need to return to the raw BMP.
    It a bit like the difference between high/low level languages. We don't normally write direct assembly (yes, I am aware that real programmers yada yada yada) but we do use it, and sometimes you actually have to write it for specialised applications - most notably for high performance.
    Both have their pluses and minuses, and you need to know when to use one over the other.

  • Could I build 1:N relationship between CMP and BMP?

    Hi, as subject, Could I build 1:N relationship between CMP and BMP?
    Thanks a lot!
    a13519

    Container managed relationships only apply to CMP beans. You can look at the DTD in appendix B of the EJB spec or chapter 10 where they make this distinction.

  • CMP and BMP

    hi there,
    is this true?
    CMP -> JTA
    BMP -> EJBContext.getUserTransaction
    note: CMP uses JTA to do transaction but BMP uses EJB api to do transaction handling.
    Thanks
    Neo

    Disagree that CMP is always better than BMP. CMP is in reality merely an implementation of BMP that provides a declarative method of providing a persistence layer. You could easily use other declarative systems to provide the same service, but you are alway relying on BMP and when CMP fails to provide you need to return to the raw BMP.
    It a bit like the difference between high/low level languages. We don't normally write direct assembly (yes, I am aware that real programmers yada yada yada) but we do use it, and sometimes you actually have to write it for specialised applications - most notably for high performance.
    Both have their pluses and minuses, and you need to know when to use one over the other.

  • Default Isolatioin level in CMP and BMP

    Hi All,
    If we don't set isolation in a descriptor (in case of CMP) then what is the default level ?
    and what is the default level in case of BMP?
    Is it a Database dependent?

    Hi,
    Didnt find this reference in any books/pdf?
    Did u find the same?
    Seetesh
    isolation-level defines a valid transaction isolation level to apply to specific EJB
    methods. The following are possible values for isolation-level:
    TransactionReadUncommitted:: The transaction can view uncommitted updates from other transactions.
    TransactionReadCommitted: The transaction can view only committed updates from other transactions.
    TransactionRepeatableRead: Once the transaction reads a subset of data, repeated reads of the same data return the same values, even if other transactions have subsequently modified the data.
    TransactionSerializable: Simultaneously executing this transaction multiple times has the same effect as executing the transaction multiple times in a serial fashion.
    For Oracle databases only:
    TransactionReadCommittedForUpdate
    TransactionReadCommittedForUpdateNoWait

  • Which should I use (CMP or BMP) for my Web Application?

    I am developing an Web Application with Oracle Database. In this work, I always use the SQL sentences in complex (Joining many tables with WHERE condition). So that, I want to be adviced in developing this web application with CMP or BMP or other opinions?
    Thanks in advance!

    If you want to write long (optimized) SQL queries, than you shouldnt use
    entity EJB's at all.

  • Nobody knows this fundamental question - CMP, CMT, BMP, BMT. Surprised !!

    Hello,
    I've talked to many experts and read books on EJB but none of them gave me a clear cut answers. What are the definitions of CMP, CMT, BMP and BMT? No one could explain "Persistent" from "Transaction" properly. No books clearly define them at all. Some say BMP means BMT and CMP means CMT. Some others say they are totally different concept. Others even say different stories. Actually, when we create EJBs (in Visual Cafe as an example), we can tell whether the bean is CMP or BMP but there os no place where we can define the transaction mode (BMT or CMT). How come do so many people get confused about this fundamental concept? Can anybody explain them clearly please?

    CMP = Container Managed Persistence
    This means that the container (part of the EJB Server) automatically handles persisting your bean to a DB. So if you have an Entity Bean, for example, that has some properties (like name, size) and a table in the database with the fields name (as a varchar), size (as an integer), then when you set the bean's properties to "Joe" and "14", you can then look in your database and those values will be there. You (the developer) do not have to write any code to put those values into the DB.
    BMP = Bean Managed Persistence
    This means that (in the above example of an EJB with properties name, size), if you set your bean's name to "joe" and size to 14, those values will NOT go into the DB unless you (the developer) put them there.
    CMT = Container Managed Transactions
    A transaction is really either one statement (or action) or a bunch of them that are grouped together. If it is a group, then for any one of them to be executed / committed, they must all execute successfully. If even just one of the actions / statements fails, they all fail (or are all "rolled back", i.e. un-done)
    CMT means that the container (EJB Server) will handle making sure that all the actions or statements from a transaction (i.e. a particular context of actions kicked off when an EJB is called) are completed successfully. If they are, the container will commit (execute) all the statements and return "success". If any one of them fails, the container will handle rolling back (un-doing) all the statements. This is VERY useful, as you do not need any special if statements or try-catches, the container does it for you.
    BMT = Bean Managed Transaction
    This means that you (the developer) will have to logically group together all that actions that you consider for a transaction. If any one of them fails, you will need to make sure all of them are rolled back and that "failure" is returned to the caller. If they are all successful, you will have to return success.
    You can do this by using the below code:
    (in all the code below, they may wrap from one line to the next, just pay attention to where the ";" is)
    //import Transaction
    import javax.transaction.UserTransaction
    //make a new transaction:
    UserTransaction userTran = ( UserTransaction ) initialContext.lookup("java:comp/UserTransaction");
    try
    //And then marking the beginning of the transaction:
    userTran.begin();
    //Then Do your stuff (i.e. the actions)
    myPersonalBusinessMethods();
    //commit the transaction cause it's all ok
    userTran.commit();
    catch (Exception e)
    //rollback (un-do) all the stuff cause error occurred
    userTran.rollback();
    Hope all this helped and finally explained it! Feel free to throw some duke dollars my way if it did! ;P
    Robert

  • Cmp and datasource

    Hi,
    I have a application with CMPs, and in my iAS there are 5 Data Sources.
    How to configure an application to access a Data Source ?
    Jordi Pinyol Essi Projects
    Ingeniero de Desarrollo
    [email protected] t +34 977 221 182
    http://www.essiprojects.com f +34 977 230 170

    Hello,I need to change at runtime the properties of
    the connection, because my database has several users,
    I am working with CMP EJB . How could I do it?
    Thanks in advanceYou may write your own data source wich you will pass required data (user name) to through some thread oriented storage...
    class Store {
    static Map cache = new HashMap();
    static void setUserName(String userName) {
        cache.put(new Integer(Thread.currentThread.hashCode()), userName);
    static String gerUserName() {
        return (String)cache.get(new Integer(Thread.currentThread.hashCode()));
    EJB:
    setEntityContext(EC ec) {
       Store.setUserName(ec.getCallerPrincipal().getName());
    YourDS:
    getConnection() {
       return ds.getConnection(Store.getUserName(), ...);
    ...

  • CMP and capture-schema problems

    I am trying to deploy a CMP on Sun App Server 8, and I'm having a few problems. I am quite new to both CMP and Sun App Server 8.
    I've created a simple table Room in mySQL DB, containing only id (varchar) and description (varchar). I'm running this command to capture the table schema
    capture-schema -username username -password pwd -dburl jdbc:mysql://localhost/test -driver com.mysql.jdbc.Driver -out test.dbschema
    Do I need to enter the -schemaname and -table parameters as well? I'm assuming that since the url is pointing directly to the test schema in mySQL and it only contains the room table, I don't need these 2 parameters.
    test.dbschema gets generated, but when I use the deployment tool and create the database mappings to the entity bean using this schema file, no mappings are created.
    Any help?

    Hello,
    I have similar problem and I'm really confused about it.
    Working with:
    Java System Application Server Platform Edition 8.1 2005Q1 UR1
    mysql DataSource and Container Managed Persistence
    mysql-connector-java-3.0.8-stable-bin.jar
    I have problem with deploy:
    Fatal Error from EJB Compiler -- JDO74025: JDOCodeGenerator: Caught an Exception validating CMP bean 'Sets' in application 'isvl' module 'isvl-EJBModule': JDO72335: If the table sets for the bean corresponding to the generated class isvl.model.set.SetBean470758938_JDOState is mapped as the primary table, it must have a primary key.Choose a different primary table or verify that the contents of the schema file are correct.
    Choose a different primary table or verify that the contents of the schema file are correct. at com.sun.ejb.codegen.CmpCompiler.compile(CmpCompiler.java:274) at com.sun.ejb.codegen.IASEJBC.doCompile(IASEJBC.java:615) at com.sun.ejb.codegen.IASEJBC.ejbc(IASEJBC.java:563) at com.sun.enterprise.deployment.backend.EJBCompiler.preDeployApp(EJBCompiler.java :340) at com.sun.enterprise.deployment.backend.EJBCompiler.compile(EJBCompiler.java:209) at com.sun.enterprise.deployment.backend.AppDeployer.runEJBC(AppDeployer.java:284) at com.sun.enterprise.deployment.backend.AppDeployer.deploy(AppDeployer.java:176) at com.sun.enterprise.deployment.backend.AppDeployer.doRequestFinish(AppDeployer.j ava:107) at com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:146) at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPh ase.java:71) at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeplo ymentService.java:633) at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentSe rvice.java:188) at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentSe rvice.java:520) at com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.java:143) at com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:172)
    Have you seen this problem?
    Thanks.

  • Can TopLink CMP and POJO persistence be mixed (for incremental migration)?

    Is it possible to mix TopLink CMP and POJO persistence in one application server container? Does anyone already have experiences with such a setting?
    Background: We currently maintain an application that uses Toplink as CMP 1.1 provider for its entity beans. As this architecture is quite out-dated, we'd like to move from CMP 1.1 to POJO based persistence with TopLink (native, no JPA) and Spring inside the appserver.
    Is only a "big-bang" migration feasible? Or is there a way to use CMP and POJO persistence with TL side-by-side in one container? That would extremely handy allowing us to migrate each entity bean at a time.
    I would very much appreciate your input/opinion!
    Sebastian
    Application server is Bea Weblogic 8.1SP6
    Toplink version is 9.0.4.9
    Java version is 1.4.2

    Thank you a lot for your answer!
    I understand that with SessionAccessor from the oracle.toplink.ejb.cmp package, we can get access to the current CMP session.
    We'd like to use the TopLinkDaoSupport class from Spring's TL integration and for this, Spring wants a session factory injected.
    Is there a way to get something like a TL session factory for use with Spring in a CMP environment?
    Thanks again for your time!
    Sebastian

  • CMP vs BMP

    hi friends
    coud any tell me the core benefits/asvantages of using CMP beans on the BMP ot vice versa!!!
    or any disadvantage of using any specific type... with that were should be use the CMP and where BMP
    thxs!

    CMP is advantegous for portability. The sql statement/parameter/tuning is done outside the java code. Very good approach if you are J2EE component vendor because your client may not use to Bea, IBM, Sun, or XXXXX product.
    BMP is adventegous if you know how to tune the sql by hand, by assumption that your tuned-by-hand sql far overperform the performance of CMP's SQL, otherwise CMP is still recomended. People won't use this approach if they sell J2EE component, why? Not everyone will use WebLogic+Oracle but your code is optimized for WebLogic+Oracle.
    Please pardon my bad english.

  • What's the difference between a web site and a web application?

    I'm stumped trying to come up to a difference between a web site and a web application for myself. As I see it, a web site points to a specific page and a web application is more of some sort of 'portal' to content and information.
    But where I'm stuck is that a web application is still viewed through a browser (is it not?) and a web site can still view content dynamically, making the line between web site and application prety gray.
    For instance, does a web site using ASP.NET or AJAX (I assume ASP.NET is AJAX's proprietary sibling, if not, ignore ASP.NET AND concentrate on the AJAX), becomes a web application because it can retrieve data dynamically and asynchronously or would a website
    using PHP and a CMS be more of a web application because it forms the pages on request, based on the request of the client and its content in its databse?
    Or maybe I'm totally wrong here - what differenciates between a web application and a website?
    http://support.peopleperhour.com/entries/68630566--C-mon-lets-Watch-The-Other-Woman-2014-full-movie-online-free
    https://glossicom.zendesk.com/entries/68643806--%D0%BC-v%C9%AA%C9%9Bc-%C3%A4st-Watch-The-Lucy-2014-full-movie-free
    https://cloudhance.zendesk.com/entries/68115098--%D0%BC-v%C9%AA%C9%9Bc-%C3%A4st-Watch-The-Lucy-2014-full-movie-free
    This is totally personal and subjective, but I'd say that a website is defined by its content, while a webapplication is
    defined by its interaction with the user. That is, a website can plausibly consist of a static content repository that's dealt out to all visitors, while a web application depends on interaction and requires programmatic user input and data processing.
    For example, a news site would be a "website", but a spreadsheet or a collaborative calendar would be web "applications". The news site shows essentially the same information to all visitors, while the calendar processes individual data.
    Practically, most websites with quickly changing content will also rely on a sophisticated programmatic (and/or database) backend, but at least in principle they're only defined by their output. The web application on the other hand is essentially a program that
    runs remotely, and it depends fundamentally on a processing and a data storage backend.
    http://support.peopleperhour.com/entries/68125597--%D0%BC-v%C9%AA%C9%9Bc-%C3%A4st-Watch-The-Lucy-2014-full-movie-free
    https://cloudhance.zendesk.com/entries/67541393--Watch-The-Godzilla-2014-free-Online-Full-Movie-HD-Quality
    http://support.peopleperhour.com/entries/68168787--Watch-The-Godzilla-2014-free-Online-Full-Movie-HD-Quality
    https://glossicom.zendesk.com/entries/68161538--Watch-The-Godzilla-2014-free-Online-Full-Movie-HD-Quality
    There is no real "difference". Web site is a more anachronistic term that exists from the early days of
    the internet where the notion of a dynamic application that can respond to user input was much more limited and much less common. Commercial websites started out largely as interactive brochures (with the notable exception of hotel/airline reservation sites).
    Over time their functionality (and the supporting technologies) became more and more responsive and the line between an application that you install on your computer and one that exists in the cloud became more and more blurred.
    If you're just looking to express yourself clearly when speaking about what you're building, I would continue to describe something that is an interactive brochure or business card as a "web site" and something that actually *does something that feels
    more like an application as a web app.
    The most basic distinction would be if a website has a supporting database that stores user data and modifies what the user sees based on some user specified criteria, then it's probably an app of some sort (although I would be reluctant to describe Amazon.com
    as a web app, even though it has a lot of very user-specific functionality). If, on the other hand, it is mostly static .html files that link to one another, I would call that a web site.
    Most often, these days, a web app will have a large portion of its functionality written in something that runs on the client (doing much of the processing in either javascript or actionscript, depending on how its implemented) and reaches back through some
    http process to the server for supporting data. The user doesn't move from page to page as much and experiences whatever they're going to experience on a single "page" that creates the app experience for them.

    ...can i make as many iweb websites as i want? ...and as many blogs as i want? ...i have never made one before....
    ....although, i do have my own small business and i do have a website that i paid a guy to make and also host....(which is a waste of $$$$ in my opinion as i think i can do a better job making one myself through iweb) ....
    ...anyways, i know it is splitting hairs but what exactly is the diff b/w a blog and a website ....i am under the impression that a blog is just a personal newsletter sort of thing,...?

  • SSO for SAP and Non-SAP applications without Enterprise Portal

    Dear all,
    Is it possible to implement SSO for both SAP and non-SAP applications without involvement of EP at all?
    I have gone through this link.
    <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/e5/4344b6d24a05408ca4faa94554e851/frameset.htm">http://help.sap.com/saphelp_nw04s/helpdata/en/e5/4344b6d24a05408ca4faa94554e851/frameset.htm</a>
    But I still i am not able to get the precise answer on how to enable SSO for both  SAP and non-SAP applications without EP.
    We have decided not to implement EP in first phase of SAP implementation. But we need to enable SSO for other SAP and Non-SAP applications.
    A detailed description on how to deal this kind of scenarios will be helpful.
    Thanks.

    A client of our's uses <b>SAP Enterprise Portal</b>, and is using the SAP SSO, which is implemented with tickets, and requires the use of SAPSECULIB.  My company provides an application for this client, and our application in hosted in our data center for the client, as a Software as a Service application, obviously across the internet.  Our client, which owns a SAP license, has asked that we support the SAP SSO as a non-SAP SSO application.  The client user's SSO ticket will be created from SAP EP, and then passed across the internet to our application, and we are to use that SSO ticket as an authentication ticket to our application.  I beleive I know how to do this work technically, having reviewed the SAP document named: "Dynamic Library for Verifying SSO Tickets in Third-Party Software"   Specification   Version 2.00  December 2005.
    My question is, does my company have the right to use the SAPSECULIB?  Where is the official download and <b>license</b> download, that indicates we can download this library, and use it to support a SAP customer?  We do not own a SAP license.  Thank you for your help.  I have searched many places in SAP support.<b></b>

  • HELP! I shut down my macbook pro and now after applications have been in full screen mode for awhile they automatically minimize and it takes me back to the desktop. How do I fix this?

    I shut down my macbook and now while applications such as safari have been open for awhile, even while active, will automatically minimize and it take me back to the desktop.  How do I fix this?

    I should add that this has happened before and I feel like it was a quick un-toggling of a box in my settings, but I can not remember what to do.

  • How to automatically open and close an application at specific times?

    Hi,
    I am trying to figure out how to open and close an application at specific times.
    I have set iCal up to open it no problem...however, the application needs you to click yes before entering into it upon boot.
    How do I do this and close the app. I tried creating a workflow in automator, but iCal simply opens the workflow and does not play it. This also does not solve the issue of needing the 'yes' button to be clicked.
    Kind regards,

    Hi,
    I am trying to figure out how to open and close an application at specific times.
    I have set iCal up to open it no problem...however, the application needs you to click yes before entering into it upon boot.
    How do I do this and close the app. I tried creating a workflow in automator, but iCal simply opens the workflow and does not play it. This also does not solve the issue of needing the 'yes' button to be clicked.
    Kind regards,

Maybe you are looking for

  • Error while executing a scenario from CMD

    I am trying to execute a scenario from CMD using the starctscen command. when I use the below command E:\OraHome_ODI\oracledi\bin\startscen EXT_DATA 002 GLOBAL it is executing correctly but I tried to create a sceduler for the execution where i used

  • Error in PO

    While creating a PO i am facing an error "Delivery of item XXX of document (PO) already completed". May i know why is this error coming up?

  • CAD Desktop - error while checking in and storing...

    Hello SAP gurus', We have one problem regarding the CAD Desktop functionality, and we believe that you could help us! We are doing some tests with CAD-SAP Integration, and when we try to check in document in CAD Desktop, we receive the following erro

  • How can I avoid hard-coding this where clause in the inner select?

    This is extremely fast, but I have to hard-code the inner-most where clause, and I obviously can't do that. I know how to work-around it by creating a function that takes the CUSTOMER_ID and returns the ORDER_ID from the most recent payment, and that

  • Best solution to the flash border in IE

    Hi, I've scoured the net looking for the solution and there seems to be quiite a few ways to get round the flash border problem in IE. Just like to ask, whats the best solution; easiest and quickest? I know this topic has been done to death but I'm n