File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

I am failed, Please help

 
bin zao
Greenhorn
Posts: 2
  • 0
  • 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.
 
Khaled Mahmoud
Ranch Hand
Posts: 361
  • 0
  • 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 ]
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic