aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes hello ! what is lock() and unlock()? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "hello ! what is lock() and unlock()? " Watch "hello ! what is lock() and unlock()? " New topic
Author

hello ! what is lock() and unlock()?

Leo Tien
Ranch Hand

Joined: Sep 10, 2002
Posts: 156
i'v seen many items about lock() and unlock() here , but i don't understand is more.
where are they used and in the assienment it is necessary???
please tell me . thank you...
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11509
    
  95

Hi Leo,
I think you started your assignment last year, so you will be working on Fly By Night Services. Is this correct?
From the instructions file you would have received:

These methods are required to allow concurrent use of the database when booking flights from multiple clients. Note that the locking required is effectively a "write" lock only. If updates occur to a record that is being displayed on another client, then no change occurs at the other client. However, if two clients attempt to perform the sequence lock, read, modify, write, unlock concurrently, then both modification attempts will be handled correctly. The aim is to ensure that if two customers attempt to book a seat on the same flight concurrently, then the number of available seats is definitely reduced by two, unless there was only one seat, in which case, one customer will be advised at booking time that no more seats are available.

That quote should answer your question about where they are used.
You have to write the code for the lock() and unlock() methods.
Regards, Andrew


The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Leo Tien
Ranch Hand

Joined: Sep 10, 2002
Posts: 156
no, Andrew, i haven't take my assignment.
but i ready to down my assignment, so i don't know much about SCJD.
i'm only want to know more about SCJD, how can start?
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11509
    
  95

Hi Leo
but i ready to down my assignment, so i don't know much about SCJD
i'm only want to know more about SCJD, how can start?

There is no time limit on the assignment, so I suggest purchasing the assignment (don't purchase the exam that goes with it though) and then you can see what you need to do. You should then see what your first steps to completing the assignment should be, and can start work. You will also then be able to ask questions relating to the assignment that you have to do.
If you don't want to spend the money on getting the assignment until you are more comfortable that you will be able to do it, then I would suggest purchasing one of the books that cover the SCJD. You can find a list of them in the JavaRanch SCJD FAQ & Links page. One of those books (The Sun Certified Java Developer Exam with J2SE 1.4) apparently works through a project that is similar in scope to the assignment you will be doing.
Also in the JavaRanch SCJD FAQ & Links page is a list of useful links you could walk through.
Regards, Andrew
Philippe Maquet
Bartender

Joined: Jun 02, 2003
Posts: 1872
Hi Leo,
I confirm what Andrew just stated. I started by reading Max's book (The Sun Certified Java Developer Exam with J2SE 1.4). It's great ! While I was still reading it, I couldn't even imagine a better start ... and now that I am doing my real assignment, I do think that I would be shamefully crawling in it if I hadn't read Max's book before.
The best investment as far as SCJD is concerned !
Cheers,
Phil.
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11509
    
  95

Hi .....
I do not think anyone will be able to send you an electronic version of this book. It is still in print, and freely providing copies would be illegal. Aparently Apress (the publisher) is talking about makining copies of their books downloadable for a fee, but I do not know if Max's book will be included in this, or when this service might be available.
If you cannot purchase the book locally, you should still be able to get it through Amazon, or you could try Apress' distributor in Singapore, or Apress themselves. Details are available on their website: http://apress.com/about/ordering.html You could try sending an email to their Singapore distributor (wendiwong@tpl.com.sg) and ask where you can purchase a copy locally.
Regards, Andrew
[ August 07, 2003: Message edited by: Andrew Monkhouse ]
[ August 07, 2003: Message edited by: Andrew Monkhouse ]
Tony Collins
Ranch Hand

Joined: Jul 03, 2003
Posts: 435
Yeah and the author answers so many questions on this forum that it's only polite to buy his book.
Tony
song bo
Greenhorn

Joined: Aug 03, 2003
Posts: 16
the URL is avaiable:
http://www.apress.com/book/bookDisplay.html?bID=39
there is one sample Chapter about NIO can be downloaded for free.
http://www.apress.com/ApressCorporate/supplement/1/39/1590590309-590.pdf
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
Requests for free electronic copies have been deleted. I'm sorry if some books are difficult to obtain in some parts of the world, but we (this site) will not support what is effectively theft.
[ August 07, 2003: Message edited by: Jim Yingst ]

"I'm not back." - Bill Harding, Twister
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: hello ! what is lock() and unlock()?