oibo8x / subsonicproject

Automatically exported from code.google.com/p/subsonicproject
0 stars 0 forks source link

Add utility method to check for DB.IsOnline() #34

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Please add a utility method on the DB class to check to see if database is
online (can connect to it).

Here's how I'm doing it now:
1. Create a Query object using one of my data tables that has data.
2. Select top 1 row from it
3. Execute it
4. If throw exception, then offline, otherwise is online

signature could be something like:
public bool IsOnline();

I'm sure there's a better way to check to see if the DB is online or not,
but the above sequence is what I've been doing for years when I was just
writing my own SQL Select statements instead of using SubSonic.

Original issue reported on code.google.com by james.e....@gmail.com on 14 Aug 2008 at 5:25

GoogleCodeExporter commented 9 years ago
I requested it a long time ago, still think is is a great idea. Testing if the
database is only is something everyone does, so why not make it in a unified 
way.

Original comment by johnramb...@gmail.com on 24 Aug 2008 at 1:41

GoogleCodeExporter commented 9 years ago
Added with revision 503 - good suggestion

Original comment by robcon...@gmail.com on 9 Apr 2009 at 1:07