As I understand, it's down to the CMP provider to 'not set' the primary key
value when the Bean is persisted. I have the same problem with IAS4.0
talking to SQLServer 7, where the primary key is an Integer with the
IDENTITY keyword (DB generates the value at insertion time). Inprise have
acknowledged that this is not supported in IAS 4.0 (CMP mechanism tries to
assign a value to the PK and the DB barfs) - and may (not confirmed to me)
have a fix in IAS 4.1.
This is vendor (CMP) specific - you need to check with the CMP provider.
Once the PK has been generated by the DB, it's value _should_ be available
in the postCreate method - at which point you could grab it and fill in the
FK value for the related objects. This may also be vendor specific ... but I
sincerely hope not!
Gluck
tim
> -----Original Message-----
> From: Atul Kulkarni(CTS) [SMTP:[EMAIL PROTECTED]]
> Sent: Wednesday, July 05, 2000 7:23 AM
> To: [EMAIL PROTECTED]
> Subject: Re: DB Generated Primary Key
>
> As I did not receive any post on this do I consider that there is no
> solution to this problem? Any hint will suffice.
>
> Regards,
> Atul.
>
> -----Original Message-----
> From: Atul Kulkarni(CTS) [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, July 01, 2000 2:17 AM
> To: [EMAIL PROTECTED]
> Subject: DB Generated Primary Key
>
>
> Hi all:
> <Q1>
> I have a case where I create many records of type PayObject where the
> primary ky is generated by the DB itself. If in this case I want to map an
> entity bean to this table, how do I do it?
>
> Also in the database there are some other records being inserted in the
> same
> transaction which hold a reference to PayObject object ( ie have a column
> which holds the primary Key of PayObject ). So how does the object know
> its
> own primary key on creation?
> </Q1>
>
> I am using WL 4.5.1 with Toplink.
>
> Thanx in advance.
> Atul.
>
> ==========================================================================
> =
> 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".
This e-mail, and any attachment, is confidential. If you have received it in error,
please delete it from your system, do not use or disclose the information in any way,
and notify me immediately. The contents of this message may contain personal views
which are not the views of the BBC, unless specifically stated.
===========================================================================
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".