Hi all,
In most database applications we want to prevent an object from being deleted if another object is referencing it. An easy way to do this is to add a collection maintained by an inverse, and then do an "isEmpty" check on the collection. If the collection is not empty, then the object cannot be deleted. A major problem with this approach is that the collection becomes a high point of contention, killing performance in high volume systems. In many cases we cannot live with this contention issue and so the collection gets removed. This leaves the question: how do we prevent the user from deleting the object if it's being used? One solution it to not allow them to delete it, and instead we hide it from them in user interfaces (by having a parallel collection that has a condition "not isHidden" against it). Another solution is we run around all objects that could reference this object and check - but in many cases this is an extremely expensive check, and it has the timing hole of allowing someone to refer to the object before the delete check has passed.
Have you had this problem in the design of your JADE applications and what strategy have you used to solve it?
Thanks,
Allistar.