Cheers, Roberto Perillo
SCJP, SCWCD, SCJD, SCBCD
Peter Gough wrote:.. at this point the test never releases the lock and the test "fails"; yet the locking code is working correctly.
Certainly I could add code that verifies that the record exists after the recordLock is successful, but that duplicates the check in the update() method (niggling point, i know).
Peter Gough wrote:Hence, it is hoped that the user of the Data class calls lock() first, but may skip it and call update() directly (which is why I chose to throw RNFE in my version of update()).
SCJA, SCJP, SCJD, SCWCD and SCBCD Certified.
Cheers, Roberto Perillo
SCJP, SCWCD, SCJD, SCBCD
SCJA, SCJP, SCJD, SCWCD and SCBCD Certified.
SCSA, OCA, SCJP 5.0, SCJD, CCDH, CCAH http://www.linkedin.com/in/carlosamorillo
I've been doing some testing using Roberto's DataClassTest.java and sometimes randomly I run into a deadlock in Eclipse or NetBeans
just by doing 1 iteration.
Cheers, Roberto Perillo
SCJP, SCWCD, SCJD, SCBCD
SCSA, OCA, SCJP 5.0, SCJD, CCDH, CCAH http://www.linkedin.com/in/carlosamorillo
Cheers, Roberto Perillo
SCJP, SCWCD, SCJD, SCBCD
Roberto Perillo wrote:Hey, champion.
So what's your assignment? URLyBird or B&S?
You don't have a Data class? Is there an interface you have to implement? I guess it has methods like lock(), unlock() and update(), right? Well, if there is in an interface to be implemented with these methods, and this interface has to be implemented with a name other than "Data", then how things work are still pretty much the same as always, just the name of the implementation is different.
And I'm quiet sure your instructions have similar "must" requirements.Your data access class must be called "Data.java", must be in a package called "suncertify.db", and must implement the following interface
Roel De Nijs wrote:Hi Blaine,
...
You have for example at least 2 interfaces: DB or DBMain. ...
Meaning all possible "must implement" interfaces in the different versions of both assignments. Your instructions will mention 1 of these (in your case interface DB, in my assignment it was DBMain).You have for example at least 2 interfaces
And also how to add client-side cookie-tracking to DataClassTest (a significant use case which is required for the 1.1.1 interface but seems to be entirely unnecessary for 1.3.1).
they will need to modify Roberto's classes significantly.
The exact signature of these methods in URLyBird 1.3.1 are:Vlad Djordan wrote:I believe for version 1.3.1, the method declarations are as follows (someone else can confirm)
Is there any other test available that someone wrote particularly for Bodgit & Scarper ?
Cheers, Roberto Perillo
SCJP, SCWCD, SCJD, SCBCD
Roberto Perillo wrote:...these tests should require only minimal edition to work with any version!
Blaine Simpson wrote:(most significantly, my Data.delete() method automatically unlocks after a successful deletion, since no good and much evil can result if that is left to the caller).
Cheers, Roberto Perillo
SCJP, SCWCD, SCJD, SCBCD
Roberto Perillo wrote:Blaine,
the main idea of this class is to be as simple as possible, without requiring ANT or anything else, for instance.
Roberto Perillo wrote:
Blaine Simpson wrote:(most significantly, my Data.delete() method automatically unlocks after a successful deletion, since no good and much evil can result if that is left to the caller).
So your delete() method deletes the record, unlocks it and notifies all waiting threads? Well, I'd say that it is better to leave this logic only in the unlock() method. The delete() method should be responsible only for deleting records. It is expected to call unlock() after calling update() or delete().
Cheers, Roberto Perillo
SCJP, SCWCD, SCJD, SCBCD
Passed: SCJP 6 (90%), SCJD 6
Other: Spring training, extensive Swing experience
John McParland wrote:I hope someone else will find it useful
Cheers, Roberto Perillo
SCJP, SCWCD, SCJD, SCBCD
SCJP 6, OCMJD6
Just tested my Data class with your test case and it worked fine.
Cheers, Roberto Perillo
SCJP, SCWCD, SCJD, SCBCD
Amateurs built google. Professionals built the titanic. We can't find the guy that built this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|