• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

GUI and Record locking

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello there,
I did not receive my voucher yet, but I'm already worried.
I was wondering how you people manage a registry update.
1)
Do you put a button that opens a new Frame and shows the current values of that registry and then the user can press a button (and in this case you lock the registry at the Frame pop up)

2)
You let the user update the registry's values right in the Table (in this case you listen for the events that tell when a cell is beeing updated and when it finishes)

hope somo one can reply me.
Itapaj�

3)
what else?

the part about locking is that (I think) there's no way a RMI object identify the client. so I thought that I could do something like this:
1- create a context for the user (a String like AF45832A (a hex String))
2- require that the client inform that context, for example:
public void update(int registryID, UserContext c)
public void delete(int registryID, UserContext c)

ps - i thought that the update method, for example, could throw something like LockNotAvailableException
 
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Itapaj�,

Welcome to JavaRanch and this forum.

I think you should get your assignment and look at it before you start considering the problems - otherwise you could end up trying to solve non existant problems .

When you are asking about how "people manage a registry update", are you asking about updating the RMI Registry, or are you talking about updating the data file provided by Sun? If you are talking about updating the RMI Registry, then it should not be an issue for you once you get the real assignment: you only need to register one object with the registry, and do not need to update it.

However if you are talking about updating the data file, then the issue comes down to optomistic locking of the data file compared to pesimistic locking (and "optimistic locking" can be a good phrase to search on). With either optimistic or pesimistic locking, you still need to validate the data after the lock is in place, which may impact on the requirements of your instructions (which may be different from other candidates instructions, which is why you need to get your assignment as a first step).

Your idea about having some key identifier for locking / updating etc. may work, but again, you must wait until you have your instructions before making such a decision. Some instructions will have a similar concept as a basic requirement (so you must do what you have thought of). Other instructions will explicitly stop you from doing this. And you have no way of knowing up front which set of instructions you are going to get.

Regards, Andrew
[ July 25, 2004: Message edited by: Andrew Monkhouse ]
reply
    Bookmark Topic Watch Topic
  • New Topic