Hello,
Is there a CSLA-compliant way to check if the database is accessible?
I need to poll and make sure that the database is currently up. Would like to make sure that whatever I do fits in with CSLA. My initial thought is to have a read only root, probably with a single property, that might return GETDATE() or similar. If Fetch fails, I'll know that the DB is not available at that time.
I realize of course (as does the client), that this is no guarantee that the network/db will be up and running immediately after, but it's a requirement.
Thanks,
Mike
Yes Mike, your answer is a good one. But Andy is right too - this should be a logical part of your object model based on a "See if database is available" use case.
So while I too would use a ROB-derived object, I'd make sure to name it and its factory method appropriately so it is very clear what it is doing:
If DataBase.IsAvailable Then
or something like that. Your factory method doesn't have to return the object - it can just return a boolean.
Copyright (c) Marimer LLC