Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regarding dependent objects of Entity Bean

 
Debanjana Dasgupta
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Eduard Manas
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
Bill Morrison
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Debanjana Dasgupta
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Bill Morrison
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic