Jay Walters wrote:

> Now in EJB 2.0 it would be much easier to implement immutable primary keys
> in the CMP environment because of the abstract persistence schema.  The
> implementation class could throw an exception on change of primary key
> fields.  Do you guys think this should be done, or still left open?
> Personally I'd like some option to go either way.

The latest spec does not permit changes to primary key fields for CMP.


> Cheers
> Jay
>
> -----Original Message-----
> From: Cedric Beust
> To: [EMAIL PROTECTED]
> Sent: 4/4/01 4:57 PM
> Subject: Re: EJB 1.1 and change of primary key values
>
>
>> From: Dave Wolf
>
>
>> Its an interesting question whether the pk is semantically immutable.
>
> I
>
>> dont see the spec every lay this out as a requirement.  Secondly, if
>
> we're
>
>> persisting to an RDBMS which 90% of people are, the RDBMS does
>
> actually
>
>> allow updates on the PK field.  So this PK mutability can occur
>
> actually
>
>> outside the EJB and bring about the same issue.  Since neither EJB nor
>
> the
>
>> RDBMS enforce the relational models view that nothing changes the PK
>
> value
>
>> (a natural key) then how can we assume it is immutable?
>
>
> Because it doesn't make sense otherwise? :-)
>
> For example, Hashtable doesn't specify that equals()/hashCode() need to
> return the same value after the object has been stored in the table, but
> the
> behavior is unpredictable if they don't.
>
> Not hard to extend this consideration to PK's.
>
> Be nice to the container and the container will be nice to you :-)
>
> --
> Cedric
>
> ========================================================================
> ===
> 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