ya but where is that sentence saying that if CMP-entityBean B2 is a cmr in
the CMP-entityBean B1 then the setters of B2 may not be called and that (B2)
CMP is read-only...
    I dont think the spec ever says that.
    Am I missing anything here ?

Regards,
kris

-----Original Message-----
From: Daniel De Luca [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 11, 2002 2:27 PM
To: 'Ramakrishna N'
Cc: [EMAIL PROTECTED]
Subject: RE: An CMR related exception


Kris,

Check paragraph: 10.3.6.1 Use of the java.util.Collection API to update
relationships

Daniel

-----Original Message-----
From: Ramakrishna N [mailto:[EMAIL PROTECTED]]
Sent: lundi 11 mars 2002 7:08
To: Daniel De Luca
Subject: RE: An CMR related exception


Hi Daniel,
   Could you please point me to the appropriate part in the spec in this
regard ? That would be great.

   Thanks in advance.
Regards,
Kris

-----Original Message-----
From: Daniel De Luca [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 08, 2002 10:28 PM
To: [EMAIL PROTECTED]
Subject: Re: An CMR related exception


Alvin,

You can't apply a Set method on a cmp-field that is used in a
relationship between 2 entities. You don't necessarily need to
initialize that field in the ejbCreate method. What you have to do is
create the Entity bean and initialize only the PK.

Then suppose EntityA has a relation with EntityB and the CMR fields are
rEntityB (in EntityA) and rEntityA (in  EntityB) In order to "set" the
relationship between the 2 you need to use the
entityBRef.getREntityA().add(entityARef).
After that your CMP-field will be up to date.


I would suggest you to read the EJB 2.0 Spec, everything is explained
there.

Hope this help.

Daniel

-----Original Message-----
From: A mailing list for Enterprise JavaBeans development
[mailto:[EMAIL PROTECTED]] On Behalf Of Alvin Wang
Sent: vendredi 8 mars 2002 16:12
To: [EMAIL PROTECTED]
Subject: An CMR related exception


Hi! I am using Weblogic 6.1 SP2 and EJB 2.0. I built a CMR between two
Entity Beans. However, I got the following exception while running:

"javax.ejb.EJBException: When a cmp-field and a cmr-field (relationship)
are mapped to the same column, the setXXX method for the cmp-field may
not be called. The cmp-field is read-only."

However, in the ejbCreate() method in CMP in EJB 2.0, I have to use
setXXX method to initialize the XXX cmp-field. Am I wrong?

Can any guru help? thanks!

========================================================================
===
To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body of the message "signoff EJB-INTEREST".  For general help, send
email to [EMAIL PROTECTED] and include in the body of the message
"help".

========================================================================
===
To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body of the message "signoff EJB-INTEREST".  For general help, send
email to [EMAIL PROTECTED] and include in the body of the message
"help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to