ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <ste...@apache.org>
Subject Re: How to check whether database exists and then proceed ?
Date Mon, 29 Sep 2008 09:50:27 GMT
Kothari, Shivani wrote:
> Hi stevel, 
> I did the same with using sql command in try catch block. I was
> wandering if there is any better approach available.

not really, no.  According to Lamport's definition of liveness of a 
distributed system, asking the far end to do useful work and timing out 
if it doesn't do it within a limit is the only way of determining if the 
system is live [1]

-If you know which port the database is you can use <waitfor> and the 
<socket> condition to spin until the database is opening a port.

-Over in smartfrog, the database liveness components we have are based 
on the <sql> task, and do issue select statements to check the database 
health. The only variation is to support drivers like mysql and any 
other with a method called ping() on them, that lets us ping the 
database without doing any work. I don't think it is that much faster 
than a SELECT though.

-steve



[1] http://research.microsoft.com/users/lamport/pubs/liveness.pdf
-- 
Steve Loughran                  http://www.1060.org/blogxter/publish/5
Author: Ant in Action           http://antbook.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message