Dilipkumar
Peter is right. you get to be synchronize the data structure, not the method(lock/unlock). The reason is if you synchronized on metnod, then you actually put lock/unlock methods into the same monitor as all public methods in Data class except you create a inner class to hold the lock/unlock methods, thus never have the effect of different record having its own lock.
But you could still use the Vector to hold the record lock, the vector is a synchronized data structure, it is thread-safe and will save you a lot if you use proporly. In matter fact, I used the Vector to store the locks in my SCJD assignment, and get a good score on it.
The critical points about the implementation of lock/unlock is that you must make locks data threads-safe, and could be unlocked even the exception occured.
David