Two things: first, you are thinking way too much Fly By Night, remember that this database is to be re-used; second, this might tell you that your assumption that maintenance is only done in local mode is incorrect. The point is pretty academic anyway - you don't have to code any of the maintenance part, the instructions simply ask you to pave the way for it.Originally posted by Shivaji Bhosale:
So if administrator only going to access DB in non networked mode, then why we need to lock the whole Database ?
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
Wow. Such a completely natural and straightforward factoring, once you've seen it you cannot imagine how you could've missed it You're not missing a thing as far as I can see.Originally posted by Gennady Shapiro:
this is two-level lock implemented according to ReadWriteLock pattern.
You cannot dispense with two different types of lock, but most implement the logic in one single monolithic block of code. The reason for this lack of separation is that, if you don't keep track of a database read lock, then you need to trawl through the record locks to see if a database lock can be granted. The degree of coupling between the two lock types is pretty high that way.On the other hand, I just dont see how you achive db&record locking with single-layered lock. Can you please explain that?
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
You cannot get rid of treating the database lock differently from the record locks, but you can roll it all into a single lock manager class and synchronize just once, no problem.Originally posted by Gennady Shapiro:
I kept thinking of HOW MY GOD HOW can I do 1 level locking for this?? The answer is no way, you have to lock DB AND Recs and synchronize on both.
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
Consider Paul's rocket mass heater. |