ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Conor MacNeill <co...@cortexebusiness.com.au>
Subject Re: Does SQL task support a single transaction for multiple sql files?
Date Tue, 18 Feb 2003 00:29:54 GMT
davexmail@netscape.net wrote:
> Hi,
> 
> We are using ANT for our deployments and want to automate the database updates as well.
We have multiple sql files for a single release to make it easier to maintain them.
> 
> When we do a deployment I want to run all the scripts in a single transaction so that
if any go wrong I can roll them all back. Unfortunately the SQL task says that it creates
a new transaction for each file, this means that if one fails it won't roll back them all.
It needs to be all or nothing when it comes to the database as the new code we deploy will
expect all the changes there and if we roll back, the old code will expect none of the changes.
> 
> Any suggestions?
> Do I need to create my own custom task?
> 

You could extend the current sql task to accept filesets for the nested 
<transaction> elements, so that all files in the fileset are executed within 
that transaction. Note, however, that filesets are unordered, which may not 
always be useful for applying sql statements. YMMV ...


Conor



Mime
View raw message