For the locking of the whole database, just assuming that the only thing calling lock that way is the server when it is trying to shutdown, I don't think you need to handle it that extensively.
It was acceptable in my submission. Stronger even, if your clients may lock more than one record (FbN doesn't, but remember this is a generic database engine) then this is the only way to avoid deadlock unless you want to impose a specific order of locking as part of the API (e.g. "multiple locks should be acquired in order of ascending record number").Originally posted by Marijana Grabovac:
My major concern is that my lock(-1) might wait forever, since I don't have a concept of who came first. [...] Is that acceptable?
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |