by
dcooper@jade.co.nz >> Tue, 27 Aug 2002 1:09:14 GMT
It seems we're talking about two issues here.
Volatility aside, whether or not you choose to register for Object_Delete_Events in the first place depends on the application. If you're happy to access cached state on occasion, or deal with invalid objects entirely with exception handlers, or make specific (ie: limited, not shotgun) use of resynchObject or locks, then you're correct that Object_Delete_Events aren't necessary.
However, the problem you're describing sounds like it's more to do with the use of system *class* notifications where instances of the class can be affected by high-volatility operations. In general, class notifications are not recommended in these situations. The issue isn't really the Object_Delete_Event as you would run into the same problem with Object_Update_Event if the batch process happened to update thousands of objects in a short space of time.
Often a good technique to address this is to switch to user notifications as you can be more specific with targets and events, and you have more control over when/if the notifications are dispatched. For example, you could implement a transient NotificationManager (say) object per process that manages a list of notifications to be sent at the end of each transaction. This list is cleared when a transaction starts (helps if you have your transactions centralised somehow) and model operations register notifications with the NotificationManager (ie: causeEvents aren't done directly out of the model - this means the NotificationManager can also filter duplicate events). Just before each transaction commits, it asks the NotificationManager to dispatch the events. For batch operations, you can then ask the NotificationManager to not dispatch any events (or ignore the registration calls from the model entirely).
User notifications can be used to implement a cache synchronisation strategy, you just have to do the resynchObject yourself (passing an invalid object reference to resynchObject doesn't raise an exception, so this approa ch will still work for user-defined delete events). Ensure you use resynchObject, *not* resynch. resynchObject is preferable to resynch in general, and resynch on an invalid object that isn't in cache *will* raise an exception.
Dean.