I am using Data class instance which implements the DBMain (Sun interface) to identify the Lock owner in lock /unlock/islock methods , is it okay ?
You have said that you do not have a cookie in your lock method and that you are using the instance of the Data class to identify the lock owner. Cool. But why does your code have a variable named cookie?
How are you ensuring that each connected client gets a unique instance of the Data class and that they continue to use this unique instance throughout their interactions with the server?