This week's book giveaway is in the Java in General forum.
We're giving away four copies of Event Streams in Action and have Alexander Dean & Valentin Crettaz on-line!
See this thread for details.
Win a copy of Event Streams in Action this week in the Java in General forum!
  • 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
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

I am failed, Please help

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am failed. Here is my result.

The maximum possible score is 400; the minimum to pass is 320.
General Considerations (maximum = 100):
100 Documentation (maximum = 70): 70
O-O Design (maximum = 30): 30
GUI (maximum = 40): 24
Locking (maximum = 80): 0
Data store (maximum = 40): 40
Network server (maximum = 40): 40

Major point loss for record-locking mechanism, which is not according to spec. Your locking code does not block when trying to lock a locked record.
--------------------------------------------------------------------
So before I submitted my assignment, I tested my locking mechanism, it did work. I don know where is wrong in my locking mechanism.

Could Andrew or anyone help me to find out where is the problem, so I want resubmit my assignment again. Can I upload my Data class here?

Thanks for your help.
 
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello bin zao,


Your locking code does not block when trying to lock a locked record



Here is what they mean :
Client A locks a Record 1. Client B tries to lock record 1 (The same record
locked by Client A),Client B should wait till record 1 is unlocked.To be more specific, the Thread of Client B should wait till Record 1 is unlocked.This should be done by using the wait and notify mechanism.
Hope that his helps.
[ February 26, 2007: Message edited by: Khaled Mahmoud ]
 
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Can I upload my Data class here?



No - but you can post your locking method (repeat: only the locking method).
 
bin zao
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bartender and Ranch hand

Thanks for your suggestions, I know now where is wrong in my code. I did following mistake:

A Client locked record 1.
B Client try to lock record 1.
B Client can not lock record 1 and get the Message: "record 1 is already used by other client", then B Client does not wait until A Client unlocks the record 1 and B Client finishes the operation. This is the mistake.

So, I will improve my assignment and post my new "lock", "islock" and "unlock" methods here before I resubmit it.

If you could check my new locking mechanism, it would be grateful.

Thanks
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The rules of the forum (see FAQ) is that you can post only one locking method. So I suggest you post only your lock method.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!