• 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
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

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
 
Put a gun against his head, pulled my trigger, now he's dead, that tiny ad sure bled
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic