Return-Path: Mailing-List: contact user-help@ant.apache.org; run by ezmlm Delivered-To: mailing list user@ant.apache.org Received: (qmail 30239 invoked from network); 18 Feb 2003 00:29:09 -0000 Received: from cortex-gw.magna.com.au (HELO smtp.cortexebusiness.com.au) (203.174.140.214) by daedalus.apache.org with SMTP; 18 Feb 2003 00:29:09 -0000 Received: (from daemon@localhost) by smtp.cortexebusiness.com.au (8.10.0/8.10.0) id h1I0TEl12913 for ; Tue, 18 Feb 2003 11:29:14 +1100 (EST) Received: from UNKNOWN(192.168.1.9), claiming to be "chunky.int.cortexebusiness.com.au" via SMTP by ctx00, id smtpdAAAY0ailz; Tue Feb 18 11:29:05 2003 Received: (from daemon@localhost) by chunky.int.cortexebusiness.com.au (8.10.0/8.10.0) id h1I0T6Z07346 for ; Tue, 18 Feb 2003 11:29:06 +1100 (EST) Received: from kooky.int.cortexebusiness.com.au(192.168.1.48), claiming to be "cortexebusiness.com.au" via SMTP by chunky.int.cortexebusiness.com.au, id smtpdAAAHlaOio; Tue Feb 18 11:29:02 2003 Message-ID: <3E517E82.5070501@cortexebusiness.com.au> Date: Tue, 18 Feb 2003 11:29:54 +1100 From: Conor MacNeill User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20021003 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ant Users List Subject: Re: Does SQL task support a single transaction for multiple sql files? References: <1020D2E1.4EA359B7.02EA0723@netscape.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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 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