Hi I have a question. Say I have 2 entity beans A and B I have a object C which is a dependent object of entity bean A. So A has 1 to many relationship with C. Is it possible to have a reference to B inside dependent object C?
I know that the spec says that the container must take care of all references to other EJBs when serializing. So my answer would be yes if you had the reference to B directly in A, because the container **must** do it. What I'm not so sure is if the reference to B is in a helper objects of A. My feeling is yes, as the container will apply recursively the same serialization algorithm (which takes care of EJB references). But not sure...
Debanjana, I must admit that I perhaps don't fully understand your question. However, I have read that it isn't a good idea to use the CompositeEntity pattern in on an EJB 2.0 platform. The issues are BMP versus CMP, course-grain versus fine-grain, and local versus remote interfaces. As Eduard points out, serializing references is a big issue and gets even bigger when you consider clustering and such. My point here is, if I understand your question, strickly speaking the answer might be yes. However, I don't fully understand your question and the more likely answer is that you perhaps shouldn't do it without understanding the availability and maintainability issues. Regards, Bill
Thanks guys for your replies. Yes, I myself had lots of doubts regarding that, thought it seemed possible. I have found an alternative solution instead. [ April 14, 2003: Message edited by: Debanjana Dasgupta ]
Another note here: I revisited the EJB 2.0 CompositeEntity issue. I have found one reference that argues that the pattern is still valid and one that cautions against its use. I'll need to spend more time on this to formulate an opinion. -Bill
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
a bit of art, as a gift, the permaculture playing cards