ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <>
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 Loughran        
Author: Ant in Action 

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message