Forums Register Login

Max, finally { unlock}

+Pie Number of slices to send: Send
Hi Max,
Your have following code in the adapter:

What if reserve is successful and modify fails:
You don't have any finally block for realease. It will be a dead-lock.
Did I understand something wrong or you just left this issue open for simplicity?

Tx,
Vlad
+Pie Number of slices to send: Send
Hi Vlad,
Sorry I haven't had a chance to catch up with you lately. I'm ever so slowly climbing out of my cave of work. To answer your question: I actually took an approach here that I advocate for the entire assignment. You don't need to deal with system failure caused deadlock. For example, what if your initial locking failed, and you tried to unlock a record that don't have locked? True, you could safely unlock, but you might be deadlocked out waiting for the monitor. So now you have to code for that. But it has it's own complications, and so on. This is a nasty kettle of fish that really never ends.
You're only responsible for logical deadlock: if you can do that much, Sun will recognize you as a Certified Developer. The type of error you're preventing here can only really occur if something beyond your control happens. Say a JVM failure, or a lightening strike, or a server crash, etc. And if it's beyond your control, then it's beyond your control
M
[ August 18, 2003: Message edited by: Max Habibi ]
+Pie Number of slices to send: Send
Hi Max,
I like your answers! Your point of view is always very challenging
Ok. Tx a lot.
Vlad
+Pie Number of slices to send: Send
I used to go out a with a girl who would say that: wasn't good then either
M
If you send is by car it's a shipment, but if by ship it's cargo. This tiny ad told me:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 806 times.
Similar Threads
Habibi's code example, locking and unlocking records
Database Thread Safety, pls review
Max. Denny's DVD Project: DVDDatabase class doubt
Max. Denny's DVD Project: GUIController class doubt
Locking issues in Max's book sample project - Denny's DVD store
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 03:38:04.