I use 3-tier mode and call lock method on the server. I passed, but I loss 36 point about Locking and 6 point about General Considerations , I do not know whether it due to 3-tier.
so I hope my score could have some value for reference. I'll fell sorry if it is against Andrew.
I use 3-tier mode and call lock method on the server. I passed, but I loss 36 point about Locking and 6 point about General Considerations , I do not know whether it due to 3-tier.
But I have not seen anything that anyone has posted that would lead to data corruption (apart from those who forget to do the check the record status after locking the record - and that applies no matter whether the locking is performed by client or server)
SCJP 1.2, SCWCD, SCBCD
"One good thing about music - when it hits, you feel no pain" <P>Bob Marley
SJCP, SCBCD, SJCD, SCDJWS, SCEA (Part I)
Originally posted by Andrew Monkhouse:
But the locking is only a logical lock that your server will use to indicate that nobody else can update the record that you want to update. It is not a physical lock on the record on disk preventing any unfriendly process from writing to the disk.
This is separate from writing thread safe code which will hopefully prevent you from reading a record while it is in the process of being written to.
Im defecting to the dark side (two tier!!!). My interpretation of the requirements (and a voice in my head) tells me to do it.
I just hope i won't be killed by the three tierers...
Originally posted by Andrew Monkhouse:
...
In the assignment I did, I showed records that were unavailable. However the user could not do anything with that record.
...
Regards, Andrew
Sun Certified Java Web Component Developer for J2EE v1.4<br />Sun Certified Java Developer for J2SE v1.4<br />Sun Certified Java Programmer for J2SE v1.4
Originally posted by Philippe Maquet:
Hi Dushy,
If you start hearing voices, I actually feel better that you move to the 2-tiers camp.![]()
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Originally posted by Paul Tongyoo:
Do you have the locking mechanism preventing users from updating records that are already "owned" by having a "lock" on them? Or do you provide for this functionality by checking if a String value exists in the owner field of a particular record?
Originally posted by Paul Tongyoo:
In retrospect, it seems records should be prevented from being deleted or having their owner-fields updated by the locking mechanism, or else there wouldn't be an occassion for a SecurityException to occur for a GUI-user (since the only place i currently have my lock/unlock methods being used are in my DataAdapter methods for update and delte (lock-update(criteria)/delete(critera)-unlock)).
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
DBMain's locking mechanism simply sucks for low-level locking -- the comments specifically state that locking is only meant to prevent writing by different clients. But what about a thread that's mid-read when another thread comes along and rewrites the record?
This makes no sense to me. I would synchronize -any- operation, read or write, for a given record. If you want to be a bit fancier, allow concurrent reads but no writing while reading and no reading while writing.
I think that Sun doesn't want us to synhcronie all methods on this or any other mutex. They want us to use locking for overall thread-safety. That means that we should lock the record exclusively (not only other lock calls of this record should wait, but also read should wait till record is unlocked). To handle create or find, a lock with -1 as recNo can be used to lock the database.
I think it breaches the requirements , because a locked record should be allowed to be read. Hovewer it seems (to me) to be a preffered solution by Sun to do it.
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Why not?I am implementing socket based solution, and of course there is no way to expose the methods to the client.
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Saheed Adepoju<br />SCJP 1.4<br />SCJD (B&S..In progress)
Oracle Certified Master Java SE6 Developer(SCJD),
OCE JEE 6 JSP and Servlets Developer,
Java EE6 Java Server Faces Developer.
Is anybody that used the 2-tier approach having the cookies in the interface
provided from Sun ? Can you tell me if this solution was accepted by the Sun examinators ?
GREAT DAY TO BE ALIVE - Beats the alternative!<br />
SCJP 5.0
Oracle Certified Master Java SE6 Developer(SCJD),
OCE JEE 6 JSP and Servlets Developer,
Java EE6 Java Server Faces Developer.
Why does your bag say "bombs"? The reason I ask is that my bag says "tiny ads" and it has stuff like this:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|