geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gianny Damour <>
Subject Re: CMR Setters & ejbCreate
Date Sat, 15 Oct 2005 01:24:48 GMT

Relationships cannot be defined in ejbCreate and should be defined in 
the corresponding ejbPostCreate. The spec says (p. 188):
The entity Bean Provider must not attempt to modify the values of 
cmr-fields in an ejbCreate<METHOD> method. This should be done in the 
ejbPostCreate<METHOD> method instead.

On 15/10/2005 3:05 AM, Aaron Mulder wrote:

>So I've noticed that if I call a setter related to a CMR in ejbCreate,
>it blows up:
>Caused by: java.lang.IllegalStateException: Identity not available
>        at org.tranql.cache.CacheRow.getId(
>        at org.tranql.ejb.OneToManyCMR.set(
>The rest is slightly different depending on whether it's a CMR setter
>or a CMP setter that happens to be for the foreign key of the CMR.
>Anyway, calling the same thing in ejbPostCreate works fine.
>(My scenario is, I have tables like Parent(ID) and child(ID, PARENT_ID
>not null) so I have to set the parent_id on the child during the
>creation process.)
>Does the spec say something about not setting CMR fields in ejbCreate
>and so I'm trying to do something wrong?  Or should we support that?
>    Aaron

View raw message