EJB design: Primitive types in PrimaryKey class

  1. Primitive types in PrimaryKey class (2 messages)

    Hi all,
    I faced astrange behaviour in JBuilder, I built 2 CMP beans and build the relation 1:m between these 2 entities, each bean has it's own PK class, one PK class with only one field, and the other with 2 fields, I used primitive datatypes (int) for the fields inside the PK's and also the same types for thouse cpm fields.

    when I try to compile using JBuilder I got the following error:
    "test.jar": [J2EE:160121]Errors encountered while compiling module 'E:\projects\test\test.jar.jar':
    "test.jar": [EJB:011017]Error while reading 'META-INF/weblogic-cmp-rdbms-jar.xml'. The error was:
    "test.jar": In relationship 'profileCodesBean-profileAttributesBean', role 'ProfileAttributesBeanRelationshipRole', a cmp-field used to implement this relationship has a primitive type. All cmp-fields that double as cmr-fields must have an object type.
    "test.jar": .

    But if I convert the data types inside the PK classes and the for cmp fields the error will not appear.

    do any body have any idea about this, I think it is not required to make the datatype of the PK fields to be non-primitive??
  2. Hi,
    I am wondering since so many people think singelton are bad design. How would you design sharing expensive to create resource. Like say JMSSender which shares a JMS Connection yet creates a session for each invoker efficent rather than creating multiple connections and other expensive to create objects. Another shared resource logger better to have a singleton than pass it from class to class? Another program properties so each class can read its properties better than passing the properties object around?I have a registery which is a groups of these shared resources efficently. I would like to here peoples alternatives people to have to singletons for sharing these resources.
  3. Hi
    do you think this is related to my question?