sumuhan umamaheswarampillai

Greenhorn
+ Follow
since Jun 19, 2002
Merit badge: grant badges
For More
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 sumuhan umamaheswarampillai

I haven't seen URLYBird. But I don't think you are missing anything. The document doesn't go into a lot of details about How you write your code.

For example it would just say 'This is how locking should work' But it is upto you to decide on things like 'should I have a class dedicated to managing locks? Should I call it lock manager? etc. Keep searching this forum about locking and you would get a lot of useful tips
I think choice C is fine. That's what I did

One of item in "What you must do" is: "Network server functionality for the database system". So I choose to do it this way - database system (so DB interface) is accessible through network.[/QB]



I would like to make two points
first:
It is upto you to make the choice but I haven't exposed all the db interface methods through network server and I got full marks for Network Server. So I don't think this is a 'must' requirement.

Second:
Even if you do make all methods available to the clients I think it will be an over kill to add complex code in the server that deals with faulty clients. If you like you can add a line in your 'choices' saying you are assuming the clients are all good ones.

It is upto you, but as someone who has passed this exam my advice would be 'keep it simple'

Originally posted by Petr Hejl:
Yes, but if the server has public interface available through network, its functionality should not depend on correct behaviour of client (user). Client may run unlock and update concurrently (for some reason - multithreaded or evil client).



Petr,
Even though the lock and update methods are public you don't have to give access to them to the client when you build the RMI interface for the client.You can just give access to your 'business' method which handles the locking and unlocking. That should solve your problem I think.

I think adding extra code to protect the server from 'evil clients' is going a bit too far. An 'evil client' can possibly delete all records! You can see it is pointless trying to prevent that kind of things

Originally posted by Alan Mc Kernan:
I thought it didnt, but I read somewhere it counts towards 10% ?



I don't think they have points allocated for the essay part.
Sun has given details about how points are awarded (OO design. GUI etc) and there is nothing about essay there.

The essay is a check to see if you have done it yourself and you really understand your code.

public void update(int recNo, long lockCookie..) {
lockManager.checkLocked(recNo, cookie);
//How can anyone unlock here?
dataSource.update();
}



here how can anyone unlock after you have checked? To unlock they will need the cookie. So Why do you think this whole thing should be atomic?.
Hi Petr Hejl,
I hope I understoon you question correctly. I think you do need to synchronize.
first,You can safetly assume that clients are always single threaded.(unless you are developing a multithreaded client which is unlikely)

But in the case of the server things are different.
Server has to answer many clients at the same time and it is going to be multithreaded.

You locking code would work like this.

A) check if record is alrady locked.
B) If it is not locked then you lock it.
c) update the record
D) release the lock

It all seems fine if there is only one client at any given time. But there will be many clients. The server will user many threads to work with those clients.

Now think about this situation.

Client X does step A. Say the record is not locked. But just before it goes to step B and locks the record the thread is made it wait and another thread (for another client Y) starts working. That does step A. record is still not locked. now that read locks the record. Now that thread is made to wait. The first thread for client X comes back to work and goes to do step B. It doesn't know that another thread has locked the record while it is waiting.

To deal with this problem you have to Synchronize. When you Snychronize the block of code for step A and B you are saying "only one thread can be inside this block of code at any given time. Another thread can come in only after the first one has finished. So if the Thread for X is blocked between A and B then no other thread can go into the syncrhonized code so another thread can't mess things up.

Synchronizing is something you need to do when working with multiple threads in situations like above. And the requirements say you need a multithreaded server. So if you don't syncrhonize the locking won't work correctly and you may lose points

[ April 12, 2006: Message edited by: sumuhan umamaheswarampillai ]

[ April 12, 2006: Message edited by: sumuhan umamaheswarampillai ]
[ April 12, 2006: Message edited by: sumuhan umamaheswarampillai ]
which version of Java are you using? If it is 1.5 you don't really need rmic

http://java.sun.com/j2se/1.5.0/docs/guide/rmi/relnotes.html

if you are using 1.4 or earlier then it could be the class path.
You might find this link helpful

http://patriot.net/~tvalesky/easyrmi.html

especially the section 'Problems that you may run into'
And it may be a good idea to go through this document in full to see if you have missed anything.
[ April 12, 2006: Message edited by: sumuhan umamaheswarampillai ]
Thanks Andrew. I have now included my long surname!
18 years ago
Sorry about the delay in answering your questions guys (Rodrigo W Bonatto ,Mathew Ung ,Mihai Radulescu)

Thank you every one for your kind comments and also a special 'Thank you' to Andrew � I have found some of your answers (to questions posted by others) very useful.

Now for the answers to your questions. (how long did it take ? what tips I have for others doing this certification and what about the data store and server)

How long did it take.

The short answer: It took ages for me. But you can probably do it in less then two months if you avoid the mistakes I have made.

My mistakes.

A) I was lazy
B) I was very lazy
C) Spent months 'preparing for the assignment' by trying to read Habibi's book (never managed to go beyond the first few chapters anyway) and the 'Developer exam' section of Philip Heller and Simon Roberts book.

Now I can't blame the authors of those books. They just didn't work for me. I should I have realized this and moved on instead of trying to read them for years. But the Heller-Roberts book was the best I could find for the programmer exam. And I can't say enough about how wonderful that book was for that exam. As for Habibi's book it just didn't work for me � Although it may have worked for others.

So after wasting enough time with those book I finally gave up and started reading the spec and tried to started on the assignment. Instead of trying to master RMI , J table etc and then start the assignment, I thought I would learn the stuff on the go. Sun's on line tutorial is a Godsend when it comes to 'learning on the go'. It is so simple and practical and 'to the point' without any time wasters. Sun's tutorial didn't work for me when I tried learning Java from scratch using it alone. (I would recommend a book for purpose). But when you know the basics and when you want get something done quickly they give you the best type of help.

But the most helpful resource was this forum. It has answered so many questions without me even having to ask!

What tips do I have for others doing this certification

Assuming you are like me (certified programmer but little or no experience with real lava coding)

here is what I would suggest.

A) get down and dirty with coding early instead of trying to learn stuff by reading pages and pages of text. That was my main mistake.


B) Use 'General purpose' lava resources (books tutorials) more instead of expecting to find all your answers from 'How to pass this certification' type of books. Sun's tutorial is a gold mine.

C)Don't be as lazy as me.

D)Use this Forum

Data server/Data store

I will add a new post on this later. Sorry, I am not well these days (Flu I guess) so hard to do lots of typing. Thanks for all the responses again and talk to you later


Sumuhan

[ February 05, 2006: Message edited by: sumuhan ]
[ February 05, 2006: Message edited by: sumuhan ]
18 years ago
OK now for the details

Section Summary: Section Max Actual Points Points
General Con: 100 97
Documentation: 70 70
OOD: 30 30
GUI: 40 40
Locking: 80 80
Data Store: 40 20
Network Server: 40 40
Total: 400 377
[ January 29, 2006: Message edited by: sumuhan ]
18 years ago
I must thank every one of you! not only those great men and women who took the time to answer the questions but also those who bothered to ask them. Your questions and answers were so comprehensive I never even had to ask a sinlge question myself. I will post more details later. This is just to thank everyone. This is a great site. And this is a great forum. And you guys are great - every one of you.

[ January 29, 2006: Message edited by: sumuhan ]
[ January 29, 2006: Message edited by: sumuhan ]
18 years ago