Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Leo Tien
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 11945
212
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Leo Tien
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 11945
212
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1872
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 11945
212
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 435
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah and the author answers so many questions on this forum that it's only polite to buy his book.
Tony
 
song bo
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic