Once liquibase hits a changeset with a precondition that fails, it stops executing the rest (unless you use the onFail="CONTINUE or MARK_RAN" attribute), so it will stop any later changesets from running until the precondition passes.
Nathan From: Szalwinski, Bruce [mailto:[email protected]] Sent: Wednesday, April 01, 2009 4:24 PM To: [email protected] Subject: Re: [Liquibase-user] staging DB changes We run an Oracle shop, so I end up using the Oracle Job queue to handle the work. During deployment, the first stage does the DDL and submits all of the jobs to the job queue and then the first stage ends and disconnects from the database. I use the data dictionary view, DBA_JOBS, to see when all of my jobs have completed. When I see that all jobs have completed, I fire up the second stage. What you propose has possibilities. In your example, if there are changes after changeSet #2, would they also fail when #2 hadn't been applied? Would every changeSet need to include the <sqlCheck> or it built-in that changeSet M can't be applied until changeSet N is applied (M > N)? ________________________________ From: Voxland, Nathan [mailto:[email protected]] Sent: Wednesday, April 01, 2009 3:57 PM To: [email protected] Subject: Re: [Liquibase-user] staging DB changes That would be a very useful feature, but currently liquibase does not support any sort of direct support for parallel tasks. Plus, like you said, you don't want the liquibase process to be hanging round for possibly days. I'm not sure how you run your jobs, however. Once concern I have is if the connection that starts the job is closed when liquibase ends, does the job end, or is there an sql call you use that tells the database to keep running it in the background? You may be able to get something going using preconditions. You can do something like this: <changeSet id="1" author="nvoxland"> <sql>SQL TO START JOB 1</sql> <sql>SQL TO START JOB 2</sql> <sql>SQL TO START JOB 3</sql> </changeSet> <changeSet id="2" author="nvoxland> <preconditions> <sqlCheck expectedValue="A USEFUL VALUE">SELECT SOMETHING TO KNOW THE JOBS ARE DONE</sqlCheck> </preconditions> </changeSet> When you run liquibase the first time, it will fire off your jobs and mark them as ran, then fail on the preconditions for step 2. You can keep running liquibase as often as you want while the jobs are running and it will hit the precondition and exit. When the jobs are done and the precondition passes, it will continue on. Would that work for you? Nathan From: Szalwinski, Bruce [mailto:[email protected]] Sent: Wednesday, April 01, 2009 2:03 PM To: [email protected] Subject: [Liquibase-user] staging DB changes I routinely have a scenario where I need to add a column to a table, populate the column with data and then set the column to not null. This would be simple enough if the table were small, but I'm dealing with a multi-TB data warehouse. What I currently do is add the column, split up the work to populate the column among several jobs and then execute the jobs in parallel. I watch to see when all of the jobs have completed and then I run a step to mark the column as required. Can a liquibase install hang around and wait the previous task is complete before continuing on to the next task? In some cases, populating the data could take many hours if not days, so I'm not sure having a process hanging around is the best idea. Thoughts?
------------------------------------------------------------------------------
_______________________________________________ Liquibase-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/liquibase-user
