• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

Regarding dependent objects of Entity Bean

 
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
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
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic