• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

JMS Dependencies Question

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I have the following design issue which I believe that JMS will help me resolve but I am not exactly sure how. I don't think that this is a new problem and was hoping that you could help me out.
I have a product called Dog House. I have another product called Dog. Dog depends on Dog House but Dog House cannot depend on Dog. Dog House can be sold separately without Dog but Dog is sold with Dog House. Dog House keeps track of Bones. Every dog in an instance of Dog has a bone (this is where Dog depends on Dog House).
If a bone is deleted from Dog House, I want all associated Dogs to first associated themselves to the default Bone before the deleted bone is removed from the database.
The default Bone cannot be removed.
So I need to do this without creating a circular dependency of Dog House depending on Dog. This means that I cannot make the Bone EJB go check the Dog database table and move any associated Dogs to the default bone.
I know that I can use JMS to make Dog and Dog House message without creating the dependencies but then my understanding is that I don't have any control of the timing of when the messages are received. This means that I could not ensure that Dog got moved to the default bone before I deleted the original bone which would cause a foreign key constraint problem.
Thanks for reading my "dog" of a problem.
Any help will be appreciated,
Katie Wright zero_celsius@hotmail.com
 
Ranch Hand
Posts: 227
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have confused me completely. A couple points follow:
The whole Dog - Dog House - Bone relationship makes no physical sense to me. Explain further.
JMS has nothing to do with solving the problem. JMS is merely a way to receive requests.
 
Ranch Hand
Posts: 1934
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JMS has message queue mechanism that can solve this dog getting notified about dog house changes. You have to implement it such that your dog processes all the dog house messages related to bones.
The other poster's statement that JMS is only for requests is bogus. JMS is used for messaging and the problem posted by the original poster qualifies for use of JMS.
As long as both Dog and Dog house classes are residing on the same system(when there is no web tier involved) the messaging can be achieved using JMS packages. If not its better to use a app server to accomplish reliable messaging.
Kishore.
 
Dana Hanna
Ranch Hand
Posts: 227
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry - JMS is merely and way to send AND recieve requests. However, I think that you are over complicating the problem. Sure - JMS would work, but is it a solution - no? JMS just garauntees asynchronous message delivery. If this is one application all within the same JVM, I don't see why you wouldnt use the Listener or Observable patterns.
Why J2EE?
 
Katie Wright
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your assistance. Sorry about the whole confusing Dog House description when trying to describe my problem generically. Anyway, we are using a web tier and a web app so we are also starting to think that JMS is not the way to go. Will investigate the specified patterns further.
 
Yeah, but how did the squirrel get in there? Was it because of the tiny ad?
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic