my dog learned polymorphism
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes DeadLock Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "DeadLock " Watch "DeadLock " New topic


Animesh Saxena
Ranch Hand

Joined: Jan 15, 2006
Posts: 62
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???
Edwin Dalorzo
Ranch Hand

Joined: Dec 31, 2004
Posts: 961
If this were a real life application, would it be?

I would try to find the deadlock cause and solve it.

Maybe you can use some logging to identify who is holding the lock.

Do you have any idea why and where these deadlocks are happening?
[ April 08, 2006: Message edited by: Edwin Dalorzo ]
I agree. Here's the link:
subject: DeadLock
It's not a secret anymore!