This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "DeadLock " Watch "DeadLock " New topic
Author

DeadLock

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: http://aspose.com/file-tools
 
subject: DeadLock
 
Similar Threads
Multiple lock requests on the same record number
How does multiple calls to lock cause Deadlock?
Suggested Locking Solution
Concurrency Issue
NX:Client crashed cause deadlock in LockManager