Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Locking in SCJD Beta

 
Ramesh kumaar
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,
In my assignment it says the lock method should
"lock a record so that the record is only accessible to this"
But again in the same spec thay say
"Locking must be implemented as advisory locking. That is, attempts to modify a locked
record will succeed, regardless of where the lock was given"
Which is contradictory with the first statement. If second one is the requirement what is the use of lock() method.
I mean if any one can modify the record regardless of where the lock was given then what is the need of lock() and unlock() method.
Search criteria:
----------------
Like Origin and destnation are the search criterias in case of SCJD. What can be the search criteria here in beta.
In the current spec it has the following requirement
"The User Interface must allow the user to book a selected record. This action must interact with other concurrent clients and update the database accordingly."
Do they mean to update the concurrent clients JTable while the db is updated or changed.
-rameshkumar
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Search Criteria:
Like Origin and destnation are the search criterias in case of SCJD. What can be the search criteria here in beta.
I permit to search for anything provided the search field content meets the required format.
For instance, I have the following fields (hotel room discount broker):
location: 64 bytes, any ASCII character (BoundedTextField)
name: 64 bytes, any ASCII character (BoundedTextField)
size: 4 bytes, numeric (BoundedTextField)
smoking: Y or N (JComboBox)
rate: 8 ASCII bytes with currency symbol (BoundedTextField)
date: 10 ASCII bytes following the format yyyy/mm/dd (BoundedTextField)
owner: 8 bytes numeric ID (BoundedTextField)
Note: BoundedTextField is a subclass of JTextField that does not allow to enter more characters than specified when building the field.
The user is allowed to enter almost anything in any field provided the entered data satisfies the content type of the field. It is not allowed to enter "gdhf" in the size field or "hjshsdcbhb" in the date field, for instance. Before running the search, every field is checked for content correctness and, if ok, the search is performed. This ensures that no bad content will ever be written within the DB.
A valid search, could be:
{"los",null,2,null,null,null,null}
which returns all 2-people rooms available at all locations containing "los" (Los Angeles, Los Alamos, Pablos Creek, Los Whatever, ...)
Do they mean to update the concurrent clients JTable while the db is updated or changed.
The way I see it is that there can be only one update in the DB (file) at any given time. If a record changes in the DB, the client result table need not be updated, in my opinion. Anyone else?
[ September 19, 2002: Message edited by: Valentin Crettaz ]
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wow Valentin, you have a totally different assignment than me.
I agree the locking in ambiguous, or however you spell it.
I just keep the same philosophy of client that locks it modifies it, I think it means that when that client calls modify, the modify method does not check to make sure it is the same client and the one that called lock. However only a client that locked a record can unlock it.
If you code lock(), read(), modify(), unlock() like in the actual SCJD, then you accomplish both goals.
I have contractors as my assignment. My search has Specialies in a drop down, and I think I will add a CheckBox for available, so that you can see all that match the specialties, or just those that match and are available.
Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic