This week's book giveaway is in the Android forum.
We're giving away four copies of Learning Java by Building Android Games and have Jean-Marcel Belmont on-line!
See this thread for details.
Win a copy of Learning Java by Building Android Games this week in the Android forum!

Nicolas Kal

Ranch Hand
+ Follow
since Sep 09, 2009
Greece, Athens
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Nicolas Kal

Andrew,

As I told earlier yes it is working. I have spoken with a representative of local Sun branch and he told me that he will try to find out what happened and why I have failed. Furthermore I asked for him ig it is logical that the previus time I had 7/80 (without working) and now I got 0/80 with locking working..Anyway I can't consume time and efort thinking on this anymore. If they had the dignity they should provide more detailed feedback if there is something that I did wrong. The feedback I got was exactly the same as the previus. I have lost points in locking and gui, of course there is no feedback on the gui, why i lost 16 points. and again the first time there were not any feedback on the gui.

Regards,
Nikolas
Roel,

I agree with you, and of course all of these that you have mentioned are also covered in my design. What you see is a small snipset and I have documented all of these in my choices.txt and why I have chosen this design principles. Everything runs in a synchronised context and i explained all the considerations and assumptions that were made to design the locking mechanism and how it should be treated. Of course we all know that programming is like a mathematical problem which will have multiple answers and what it maters in the end is to get the desired result. So yes it might be difficult for someone to understand my design by just looking at one piece, as it will be difficult for me to understand the design of someone else but not looking the overall picture.

From my first submission if you remember i was frustated because of the delay and the luck of communication because I knew that i hadn't correctly so I did't want to wait no more than 6 weeks to receive an "F" and that is what happened. When I received the report i didn't got 0 out of 80 for locking, i got 7 out of 80. My locking mechanism was working but the stupid think I have done is that instead of putting the thread to wait and notify after I was throwing an exception and that is why I failed and I believe that is the reason why I did not took 0 out 80. The assumptions I made from this is that my assessor actually evaluated the locking mechanism I have implemented althought it was not working correctly, am I correct so far? And very correct my assessor didn't gave me full credits on consideration since my assumptions was incorrect (exception thrown), am I still correct?

Coming to the second submision I had to do minimal changes to my code, nothing else was changed apart from the locking mechanism that introduced the required functionality. As every logical person will think since I made changes I thought I should update the choices.txt. I explained in detail how the mechanism was working, how it was implemented in the first place and what I did to fix. I explained the possible scenarios that can occru and what happens.

Taking a closer look at my score report you can see that I have full credits for the general considerations and 0 point for the locking. How is it possible to have full credits on the general considerations and receive 0 on locking since locking by itself is the one major consideration. We have allready reached to a conflict! And how is it possible, the exact the same design, improved and working to receive less points from the initial that was not working, conflict number 2 !

In my choices.txt and in my assumptions I explained in detaild that the data class is accessed only by the remote business interface. Furthermore I explained how the lock / unlock / isLocked methods will behave within the Data class and for the overall design of the data class again i took 40 credits. conflict number 3 (suppose there was an error there)

In the company I work it is mandatory to take as part of the training the SCJP which I allready had but I wanted to take the SCJD for personal satisfaction. I don't believe that solutions architects and senior developers that deal with enterprise applications are unable to understand a simple wait / notifyAll and that told me that I had it correct and it is working just to make me feel good.. Personally I see it as a joke, let's not fool ourselfs, it does not has the complexity that we deal as software engineers in the industry..Of course it needs to carefull (something I paid in my submission for a silly mistake) but it's not the task that is impossible to do..

Which are my assumptions? I believe that the assessor that I had this time did not assess my locking mechanism properly and probably it was assessed in a hurry. YES if you don't read my considerations and you test my class with your own consideration of course it will fail but this will apply to anyone, its like a jackpot but the difference is that you don't want to hit the jackpot here.. As a java programmer and as software engineer working in the industry I find it difficult to believe that I failed when it had been actually implemented what was requested. I even recorded a video with snagit having three clients running and accessing the same resources and send it to them..

I know that probably that I will not find my right but it's "cheap" on behalf of Sun to tread us like dollar bills, or EURO bills in my case. Their customer support is the worst I have ever seen. During the 8th week of my first submission I couldn't get a reply from them and I send an email expressing my dissatisfaction to a woman called "Jenice Jensel" who is the one who used to communicate with me in order to provide me with payment details and i got an email from Eric Boice (from his personal email not the who2contact) saying to me to send him an attachment of my assignment so as he can hand it for marking. WTF is going now? 3 weeks later he was reassuring me that the grading process started when I submited and 8 weeks after he asks for an email attachment and sent me the feedback within 5-7 days. So i suppose this how much time they devote, maximum 5 days to mark an assignment and they are just feeding as cr*p saying that it will last 4-6 weeks and that is prometrics fault and we can't access your essay.. Is this a professional treatment on behalf of Sun? And after all of these how am I supposed to trust the assessor and the way he/she marks my assignment?

Just to not be missunderstood, i don't say that i don't make mistakes or to brag "oh i'm working in the industry", but when I build a product i know if it has minor points and if it needs adjustments and in that case (resubmision) i shouldn't have failed, furthermore when I have the feedback from my team members who are working for years and they are allready certified and their experience is far more extensive than mine i can't believe it that i was unable to build successfull this simple wait/notify task..If it is like this i will sell my degrees,certificates and I will go to sell pizza and I will have free food (BTW again to not be missunderstood i respect all kind of work, and I have been working a waitor while being a student)

Anyway..We'll see what will happen..
Andrew the lock, unlock, isLocked are used, that's why in my first submission i din't received 0 out of 80 ! And yes I did used the tool to check if it works and yes it is working. Trust me the Data class is designed and lock / unlock / isLocked are called from the classes within the server, not at an application level, honestly there is absolutely no reason for this. It does not even makes sense why i received even less than the first time! But i can reassure you that the locking is performed on the server side and not on the client side

The score i received is the following
General Considerations (maximum = 100): 100
Documentation (maximum = 70): 70
O-O Design (maximum = 30): 30
GUI (maximum = 40): 24
Locking (maximum = 80): 0
Data store (maximum = 40): 40
Network server (maximum = 40): 40

Only from the scores you can identify that the data class is designed with no errors, i got 40/40 (exactly as the previous time).

I'm pissed off, the first time it took them 9 weeks to publish my results, after the 6 week i was contacting them to see wtf is going on. I know the first time it was a mistake i made because i was throwing an exception and that's why i failed. The second time I failed with 0/80 with a working locking mechanism?? I am working for one of the most global prestigius IT companies and even consulted one of the senior architects to see if I my approach was actually incorrect, what more can i say, should i pay again for a voucher? there is no possible way to again all that money, i paid so far around 900 EURO and all for nonething and to recieve a copy paste feedback, f**c it if they don't respect us and if they don't even have the dignity to provide a more detailed feedback. Personally i believe that the second assessor didn't even bother reading what I have actually done and how I implement it. Just run an automated test, anyway I don't know what to say anymore, I will go to my local Sun branch and I will camp there until i get an answer, i'm totally disapointed

Personally I believe that this is all hapening because I made serius complaints the first time about the delay in the whole process and the fact that their support department did not replied to emails.

I have read an older post from this forum that one other rancher had the same problem with me, with him they have evaluated again his solution and he got the certificate because locking was working...I hope the same will happen to me

Regards,
Nicolas
Hi Andriy,

I don't disagree that there are and other aproaches, but searching throught this forum and not just this forum the majority has used wait and notify and all passed, yes i agree that there might be other ways but this does not mean that any acceptable solution which satisfies the requirements is a candidate to fail. And at least in my case the locking mechanism was working properly. How can you justify it that the first i did an incorrect implementation and got more marks than the second time that i actually implemented according to specs?

Regards,
Nicolas
Dear xxx,

I have strong disagreement regarding the grading of my SCJD resubmission. The first time I submitted my assignment I understand that the locking facility was implemented incorrectly (I received 7 out of 80).

In the resubmitted assignment I have corrected the mistake and I strongly disagree that record locking is not working. I have searched through forums, I have consulted other developers, read books and the way I have done it works. How is it possible last time to receive 7 out of 80 without having a working solution and now receive 0 out 80 when it is actually working??? I am providing a video demonstration that clearly provides evidence that the record locking is working according to the following specification “Any attempt to lock a resource that is already locked should cause the current thread to give up the CPU, consuming no CPU cycles until the desired resource becomes available.” In the attached video you can see that the first client Opens for the first record “Dew Drop In”. At this point the lock is hold by that client. While the lock is held the other two clients request an edit on the same record. Since the record is locked the threads are put to wait, consequently “Any attempt to lock a resource that is already locked should cause the current thread to give up the CPU, consuming no CPU cycles until the desired resource becomes available.” When the thread that holds the lock performs the update the waiting threads are notified and one of the two waiting clients is awake and holds now the lock for the updated record.


In the RemoteDataSimulator class there are two new methods lockHotel and unlockHotel which their main purpose is to allow a thread to lock a resource. If you open the HotelLocker class when a thread requests a lock it first checks if the record is locked by other thread. If it is locked the thread is put to wait, thus meaning “Any attempt to lock a resource that is already locked should cause the current thread to give up the CPU, consuming no CPU cycles until the desired resource becomes available.”

public void lockHotel() throws RecordNotFoundException, FileNotFoundException{
while ( isRecordLocked() ){
try {
Data.singleton().wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
}


When a thread finishes with a record the thread notifies all of the waiting threads thus meaning the following “consuming no CPU cycles until the desired resource becomes available”.

public void unlockHotel() throws RecordNotFoundException, FileNotFoundException{
Data.singleton().openFile();
Data.singleton().setUserId(userId);
Data.singleton().unlock(hotelCode);
Data.singleton().notifyAll();
}

With what criteria was my locking mechanism evaluated?? What am I supposed to do? Buy a third resubmission voucher? For what reason? To supply again this solution since it is working? I have consulted other sun certified developers and all agree that my solution is according to specifications and that I shouldn’t have failed? Do you use any kind of automated tests to see if record lock is working? Because my record locking mechanism is placed on the RemoteDataSimulator and not on the Data class. There is no restriction on the instructions and I have indicated the way my locking mechanism works and honestly I don’t see why the assessor failed me this time.

I understand that first time that I failed because I was throwing an exception, but now what have I failed again when there is the appropriate usage of wait(), notifyAll()??? What else do I have to do?? Everyone else is following the same approach with the difference that others place it on the Data class, again there is NO restriction specified regarding where to place the locking mechanism and there is NO justified reason why I received even lower mark than the last time. I expect a more detailed feedback than this “Major point loss for record-locking mechanism, which is not according to spec. Your locking code does not block when trying to lock a locked record” This is copy paste message and I deserve better treatment after the total of 800-900 EURO I have paid so far.

I expect an immediate answer on this topic or I would like to speak in person with the accessor since this is insane.
Prakash,

At line 1 (9 in the snipset) object 'o' references to the same object reference of p
At line2 (11 in the snipset) object 'o' references to the array reference of variable a in line 10

Regards,
Nicolas
8 years ago
Nadeem...

No offense but I think that the purpose of this forum is not to give us your assignment and to provide you a ready solution.. I suppose that this is an assignment that you have to do for one of your courses, when i was a student (long time ago ) i remember students in my class where they submitted an assignment that was working but when the assessor asked them to run it using command prompt they didn't even knew how to run it.. My suggestions is to read the tutorial provided by Sun and you will see that it is fairly simple to follow some simple steps and produce a solution.. After all you are not required to build an enterprise application, build first your gui and its logic and then proceed with the IO operations.. In the meanwhile if you have any questions that are of kind "I get the following exception, what does this mean?" i believe that everyone in here will help you..

Otherwise if you insist on the same approach, change the topic to "I am paying to have my assignment ready by tonight" and trust me i'll be the first one to reply Because this becomes business

Regards,
Nicolas
9 years ago
Lakmal,

List<Base1> : A list that holds elements of type Base1
List<T extends Base1> : A list that holds elements that are either of type Base1 or they extends Base1.class

When applied to class:
In the following abstract class there are two infer types, notice that the H extends Model is used and that the H is used in the abstract class



When a concrete class extends the abstract class the H will be "replaced" by the Hotel class



It is a good design aproach when you have to deal with common functionalities but you have to work with different implementations

Regards,
Nicolas
9 years ago
Jarek,

I believe on their value on the industry as certificates but as you said at least expect a level service. What makes me furius is that there is always the chance of having failed and if that is the case i don't really see any point of why waiting. I got an email and they ensured me that my results will be out by Thursday.. Let's see.. Are they going to precise to that? By then it will be 9 weeks in total

Regards,
Nicolas
Jarek,

In the certification database under history there should a record like this which indicates when it was sent to the assessor.

Sep 17, 2009 Sep 15, 2009 Exam (310-027) Sun Certified Developer for the Java 2 Platform (310-027) - Taken



As you can see mine was matched and the grading started on 17 Sep and still no results..
Honestly I don't know what to say any more.. Personally I regretted that I paid 535 EURO to receive such kind of service.. With that kind of money i could have bought vouchers for SCBCD, SCWCD and SCDJWS through whizlabs and we all know that J2EE is far more popular in the industry..

Regards,
Nicolas
Stefan,

Personally i don't think that there is any problem...It's just an excuse for the unreasonable delay. I've contacted prometric to verify the problem and so far i don't have any answer. It's not an excuse from Sun to receive email like "I've been ill that's why i delayed on answering" (YEAH I RECEIVED IT TODAY) it's like telling them sorry but my dog ate the choices.txt and that is why i did not submit it. Honestly i'm furius and i don't know what else to do.

Regards,
Nicolas
Andrew,

I agree 100%. This is the approach I followed in my implementation. I mentioned possible ways to unlock a possible "broken" locked record but said that it is not implemented since it is not requested at the momment. As long as it is justified properly and list all of your assumptions that lead you to your design you don't have any problem..And the design of course should enable future enhancements with minimal dissruption as possible.

Regards,
Nicolas
Marcel,

By book it means that it should allow the user to select a record and then enter a customer id representing the customer that the booking will be made for.

How you will handle lock/unlock is entirely up to what assumptions you will make. There are solution where the record is locked just before the "SAVE" button is pressed and unlocked immidiately after the transaction is completed. In my case I have chosen to lock the record when the booking process is starting and unlock it when it completes. Just remember that whatever reasonable choise you make you should justify it in your choises.txt and you will not have any problem

Regards,
Nicolas
Marcel,

I think that it is a very controvertible issue. If I have failed to implement a "must" requirement I believe that I would have received an automatic failure after 8 weeks. Take a look at the following thread where the same happened. There was no automatic failure but Laura Pecoraro received 0 out of 80 points for locking and in combination with some loss on the GUI part it costed her certificate.

The instructions specifies the following:

Your server must be capable of handling multiple concurrent requests, and as part of this capability, must provide locking functionality as specified in the interface provided above. You may assume that at any moment, at most one program is accessing the database file; therefore your locking system only needs to be concerned with multiple concurrent clients of your server. Any attempt to lock a resource that is already locked should cause the current thread to give up the CPU, consuming no CPU cycles until the desired resource becomes available.



Yes according to the instructions I have failed on locking a hotel record (mechanism works, threads are not waiting) BUT the server can handle multiple requests as all code is synchronized. I believe that was simply unfair for Laura to receive 0/80 since Locking is not just about locking one hotel. I mean if you have successfully locked a hotel and put threads to wait but there was a pure implementation on the data class not synchronizing threads you will receive 80/80 ?

Regards,
Nicolas
Marcel,

In real life situations this is what happens as you described (inform the user). According to my experience if a record is locked then you should inform the user that the record is locked, there is no need to block the user's actions until it becomes available..Furthermore imagine what would be the results in the scenario where multiple clients are trying to lock the same record. A large waiting queue will be created which is not user friendly. Of course there are cases where the clients requests some business logic if this occurs, timeout, etc...

Regarding the assignemt and my implementation I have been a bit missleaded with resource locking and I have implemented the way I have described above. My initial understanding was that resource locking is not only targeted to locking a hotel. A locked resource according to my opinion can be a hotel, the Data class itself, a data structure, etc.. I have tested my code and threads are queued and waiting for other threads to finish in order to continue regarding locks hold by the data class but if a hotel is locked i'm notifying the user.

I believe that it is entirely to the assescor's judgment of how it will be marked and how it is justified on the choices.txt. Still I haven't got my results (8th week of grading) when I'll get them i'll let you know the comments I got.

Regards,
Nicolas