File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Unlocking database ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Unlocking database ?" Watch "Unlocking database ?" New topic
Author

Unlocking database ?

Gurpreet Saini
Ranch Hand

Joined: Jun 09, 2002
Posts: 295
Hi reader,
Is it necessary to unlock the entire database once it has been locked ?. As far as instructions says it has not specified about unlocking the database. However, please tell me that shall I go with unlocking or simply lock the database and document.
Thank you,
Stephane Weber
Ranch Hand

Joined: Mar 07, 2002
Posts: 110
Hi,
I think what they wanted at SUN is that you implement the unlock method that matches the lock method.
In the case of a whole database lock however, it could only be used in case of database maintenance or so.
So I would say that if you just implement these methods and specify in your doc that they are there for maintenance reasons, that would be enough.
If I'm wrong, please anyone correct me
Stephane
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Hi Gurpreet,
As for unlocking the database, there seems to be two schools of thought. About half think it is unnecessary and the other half that it is. I chose to allow unlocking due to my overall architecture. My server could in theory handle multiple tables and could handle multiple connection types like automated table updaters, so in those cases it would be necessary to temporarily lock the database for the update and then unlock when updating was complete. Of course that is not a requirement for this assignment so you have no obligation to allow for unlocking the database.
Hope this helps,
Michael Morris


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Gurpreet Saini
Ranch Hand

Joined: Jun 09, 2002
Posts: 295
H morris,
I am Still
John Smith
Ranch Hand

Joined: Oct 08, 2001
Posts: 2937

I am Still

I think what Michael is telling you is that it is up to you if you want to implement (or not to implement) unlock(-1). The requirements are silent on that issue, and therefore it is your design decision (which you need to document). I happen to be in that "other school" that Michael mentioned and I chose not to implement unlock(-1) and got a full score for the server design. However, if your overall design implies the use of lock(-1), implement it by all means.
Eugene.
Gurpreet Saini
Ranch Hand

Joined: Jun 09, 2002
Posts: 295
Hi konovo,
I got it and I will not implement unlock(-1). But tell me how shall I document my design.txt file. Do I have to defend my design and besides that document my designs drawback's ?. I am not sure how to document in Design.txt ?. And is there any specific guidlines set by sun while defending your design choices or can I simply write in my own words ?.
Thank you,
 
 
subject: Unlocking database ?
 
Similar Threads
Lock/Unlock - same thread?
Clarification of the requirements
LockManager as member of Data object
Unreferenced()
to stop unlocking an account from if failed attempts is more than 5 within 24hrs