• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

URLyBird: RMI Factory Pattern with Multiple Clients

 
Michael Vargenstien
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jedi Council,


Agian, paronia has struck me at the hours of the night before submitting my assignment. Agian, I find myself with a delimia that, at this point, I think is what I intended but not 100% if I will lose some points on it or worse fail. I have implemented a RMI factory which turns a unique instance of my high level interface (Decorator of the given SUN interface). The thing is, if I have multiple clients when I book in one, it doesn't reflect in the other at run time/real time, only when the client is launched to the latest updates reflect accurately. I think this is because, each object has its own instance of the database where operations may be foriegn to each other.

Is this a show stopper?

Yours Truly,

The Original Ch w Yun Fat
 
Ken Boyd
Ranch Hand
Posts: 329
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my program if you have 2 clients accessing server then updates will be reflected in updating client (other will have old data in display). But in case other client try to book deleted record (done by any client) it will come up with error message and latest data gets populated from db file. So every time client try to update/delete/book/add records it will check latest data in db file.
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Michael

This is the the "client notification" issue, you can find a lot of solution on this forum - just make a search after - "client notification".

IMHO the "client notification" is a must issue, even if is not explicit specified. One of the easiest solution is to add an extra check on your middler layer (a safeguard). This safeguard compare the actual value from the client with the value from the database before it operate an entry. If the values are different then it throws an exception.
I think that is also acceptable to skip this is you ask the user to update its entry before every action - and of course document this.

Regards M
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic