Re: Migrations not executed at startup problem (SOLVED)

2011-04-06 Thread Chuck Hill
Another good reason to choose #1! On Apr 6, 2011, at 2:41 PM, Jon Nolan wrote: > This is a bit of an aside probably not relevant to most but be warned that > ApplicationDidFinishLaunchingNotification does not fire under servlet > deployment. > > On 4/6/11 3:37 PM, Amedeo Mantica wrote: >> Hi

Re: Migrations not executed at startup problem (SOLVED)

2011-04-06 Thread Jon Nolan
This is a bit of an aside probably not relevant to most but be warned that ApplicationDidFinishLaunchingNotification does not fire under servlet deployment. On 4/6/11 3:37 PM, Amedeo Mantica wrote: Hi Miguel, you are having the same trouble I had some time ago. i solved using an NSNotificatio

Re: Migrations not executed at startup problem (SOLVED)

2011-04-06 Thread Mike Schrag
> I am not sure why finishInitialization() is called before migrating: I think because when I wrote migrations, I was using that method for something that had to run before migrations :) When you write migrations, you can put it before ;) > It would be a good place to to do post-migration work i

Re: Migrations not executed at startup problem (SOLVED)

2011-04-06 Thread John Huss
But when didFinishLaunching happens the app is already accepting requests (if concurrent handling is turned on), isn't it? I thought so; if so, that's not a good place to do something that your app requires to run correctly. John On Wed, Apr 6, 2011 at 2:02 PM, Miguel Angel Torres Avila < mig...

Re: Migrations not executed at startup problem (SOLVED)

2011-04-06 Thread Miguel Angel Torres Avila
Nope, It did not work for me. Same error, it looks like the Migrations functions are called after finishInitialization also. Thanks for the hint. This is the code in my Application class On Apr 6, 2011, at 1:12 PM, John Huss wrote: > Or move your own startup code to finishInitialization(

Re: Migrations not executed at startup problem (SOLVED)

2011-04-06 Thread John Huss
Or move your own startup code to finishInitialization() instead. On Wed, Apr 6, 2011 at 1:07 PM, Miguel Angel Torres Avila < mig...@toracom.net> wrote: > Thanks Chuck, Paul and Mike for your help > > The principal problem was that Migrations functionality is called > automatically after my own co

Re: Migrations not executed at startup problem (SOLVED)

2011-04-06 Thread Miguel Angel Torres Avila
Thanks Chuck, Paul and Mike for your help The principal problem was that Migrations functionality is called automatically after my own code that loads some info from de data base, so if the migration has changes in a table that is considered in my code the app crashes before the migration occur

Re: Migrations not executed at startup problem

2011-04-06 Thread Paul D Yu
Look at the _dbupdater table in your database. It should have a row in there with your EOModel name in it; set the version back to null. Paul On Apr 6, 2011, at 1:43 PM, Mike Schrag wrote: > More than likely you've already run once, and the migration did nothing, so > it succeeded, and it's

Re: Migrations not executed at startup problem

2011-04-06 Thread Mike Schrag
More than likely you've already run once, and the migration did nothing, so it succeeded, and it's not going to run it again unless you modify the data in the migration version table to reset it back. On Apr 6, 2011, at 1:24 PM, Miguel Angel Torres Avila wrote: > Thanks Paul > > For some reaso

Re: Migrations not executed at startup problem

2011-04-06 Thread Miguel Angel Torres Avila
Thanks Paul For some reason the code inside the upgrade class is never called. I think I should mistyped something. I am checking now. On Apr 6, 2011, at 12:16 PM, Paul D Yu wrote: > Miguel > > You will need to call the external sql script from inside of your > Migration.java file. > >

Re: Migrations not executed at startup problem

2011-04-06 Thread Miguel Angel Torres Avila
Thanks Chuck The Application class extends ERXApplication. But I just tried the code and the > migrator().migrateToLatest(); line of code is reached but nothing happens. I just added a System.out.println like this in the com.toracom.app.migration.DInAdminEOModel1.java class @Overri

Re: Migrations not executed at startup problem

2011-04-06 Thread Paul D Yu
Miguel You will need to call the external sql script from inside of your Migration.java file. @Override public void upgrade(EOEditingContext editingContext, ERXMigrationDatabase database) throws Throwable { ERXJDBCUtilities.executeUpdateScriptFromResourceNamed(database.adaptorC

Re: Migrations not executed at startup problem

2011-04-06 Thread Chuck Hill
Is this a "full" Wonder app, extending ERXApplication? If not, you need to initiate the migration: if (ERXMigrator.shouldMigrateAtStartup()) { try { migrator().migrateToLatest(); } catch (

Migrations not executed at startup problem

2011-04-06 Thread Miguel Angel Torres Avila
Hi all, I am trying to implement Migrations in an existing Application. I followed the instructions in this page: http://webobjects.mdimension.com/hudson/job/Wonder/javadoc/er/extensions/migration/package-summary.html and this one http://webobjects.mdimension.com/hudson/job/Wonder/javadoc/er/