with this. I'm also not sure (yet) that a client doesn't need to import the suncertify.db package...
Any additional classes you create that are related to the database should be placed in the suncertify.db package
So by binding the Data class into RMI, you have to rely more on that Data class to handle more things. First you have to change the signatures of all the methods, and also have it extend UnicastRemote. Not really a good design there.
1. if all the methods are syn. then why we need use of HashSet in lock/unlock?
2. in any case, if object is same and all the methods are syn. then operating on single record means blocking all the threads or you can say locking all the db operations.
I don't think using a file is a very elegant way of doing this. Personally, I plan on using one of the containers in the Collections API in java.util. I haven't decided yet but am considering HashSet. You could then check to see if your Collection already contained a lock on the requested record and if so you could wait() for the lock to be released. Of course everytime a lock is released, you'll need to notifyAll().