This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
I have just completed my Data Layer. I was testing it for multiple threads operating on the same Data class. If 30 threads call lock on SAME Data class to delete a record (different or same) it is working fine.....but for more threads it DeadLocks.
My Data class is not static. Clients will use different instance of this class. But I am assuming if the user wants to delete a record then read and then update.....concurrently....then it becomes a problem. Is blocking an accepted solution?
Cos then I won't have to change my Data layer to handle deadlock and allow only one lock for a client. In my SocketClient I can block until this request is complete...
There's no specific mention of "DEADLOCK" in assignment but it says " Your server must be capable of handling multiple concurrent requests". Since Data Instances are different for each client it can easily do that.
Is blocking from Client Socket an Accepted Solution??? Please let me know???