• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

GUI and Record locking

 
Itapaj� Takeguma
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • 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
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12007
215
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • 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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic