If the code is unable to get the object, then nothing / null is returned.
Why would you bother to cache an object if you would have the chance of removing it so frequently? Its better to set an expiration time and reload the object if its no longer in the cache.
Can you explain "DB aware object"? Do you mean a sql cache dependency, or just an object that has information about a db connection?
EDIT:
Reponse to comment #3.
I think we are missing something here. Let me explain what I think you mean, and you can tell me if its right.
- UserA checks for an object in cache
("resultA") and does not find it.
- UserA runs a query. Results are
cached as "resultA" for 5 minutes.
- UserB checks for an object in cache
("resultA") and does find it.
- UserB uses the cached object "resultA"
If this is the case, then you dont need a Sql Cache dependency.