j2ee cmr question

B

Big Jim

Hi folks,

I have a 1 <--> N relationship between A and B.

In a client (a servlet) the following works fine:
a = AHome.create(...)
b = BHome.create(....a)
in the post create of B I do setA(a)

However I want to do this in the client:
a = AHome.create(....)
then in the post create of A do b = BHome.create(....a)

i.e. I want to create the relationships in the create of the "master" bean
so that the client only has to create this single bean.

However, this fails with :
EJB Exception:: java.lang.IllegalArgumentException: [EJB:010133]Illegal
attempt to assign a removed bean to a CMR field. The EJB with primary key
'188' has been removed and cannot be assigned to this CMR field.

Is there some way I can do this? (WLS 8.1)

Cheers.
 
B

Big Jim

In case anyone's wondering, it can be done with some pretty fiddly mucking
with the WLS descriptors. It's not recommended in their docs though, they
say you shouldn't create related beans in postCreates, just set the
relationships there.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,816
Messages
2,569,706
Members
45,495
Latest member
cberns21

Latest Threads

Top