EJB design: Primitive types in PrimaryKey class
- Posted by: Hasan Kiwan
- Posted on: September 11 2003 03:07 EDT
I faced astrange behaviour in JBuilder 188.8.131.52, 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.
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??
- What alternatives to singletons are there for sharing resources? by Ben Nice on September 11 2003 07:21 EDT
- What alternatives to singletons are there for sharing resources? by Hasan Kiwan on September 15 2003 10:26 EDT
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.
do you think this is related to my question?