CMP and Primary Key

Discussions

EJB design: CMP and Primary Key

  1. CMP and Primary Key (7 messages)

    hi all
    i am using CMP bean for table called Address this table dont have primary key ?? what next !!!
    wether BMP is the only solution for this !!!
    Thanx in Advance
    Manoj

    Threaded Messages (7)

  2. CMP and Primary Key[ Go to top ]

    Have a serial id field and make it a primary key.
  3. CMP and Primary Key[ Go to top ]

    You could also use a timestamp.

    Regards
    Ajeet Koru
  4. CMP and Primary Key[ Go to top ]

    If you have a table in a relational database without a primary key someone should take your DBA out in a field and shoot them :)

    Relational views would say a table that you believe has NO primary key does indeed.... Every column of the table is the key. Relational design requires tables to have primary keys.

    Sorry, old school data modeler here....

    Dave Wolf
    Internet Applications Division
    Sybase
  5. CMP and Primary Key[ Go to top ]

    I agree with Dave here. I see so much database design with no primary keys defined. Guys, a table with no primary key is bad design!!!!
  6. CMP and Primary Key[ Go to top ]

    Another one of the benefits of EJB, we've got a ton of people trying to desig databases who don't understand them other than what Sun has told them.
  7. CMP and Primary Key[ Go to top ]

    Well this discussion opens up a pretty major can of worms overall. I mean if you follow on concerns with CMP to how it maps to a relational database, you begin to wonder why have a database at all? For instance, to maintain good consistancy and prevent the formation of undetectable diamonds you need to prevent the stove piped access to the underlying db data. If you dont, after an ejbLoad() users can modify the underlying data which can only be detected in a passive way through optimistic locking etc.

    So now if this is true, we cant have stove piped access to the underlying data as it may become inconsistant leading to the corruption of data, then we begin to wonder why do we neeed O:R mapping at all? I mean if I cant get in there and touch it anyways, why store in in a readable fashion. So therefore I dont need O:R mapping of CMP at all, I only need opaque storage. If this is so why do we need the relational database? Why not use an object database. But wait, then why doesnt the CMP engine BECOME the object database......

    It becomes a nasty argument.

    Dave Wolf
    Internet Applications Division
    Sybase
  8. CMP and Primary Key[ Go to top ]

    Thanx All !!!