Re: Migration and use of ERXJDBCUtilities.executeUpdate
Re: Migration and use of ERXJDBCUtilities.executeUpdate
- Subject: Re: Migration and use of ERXJDBCUtilities.executeUpdate
- From: Helmut Schottmüller <email@hidden>
- Date: Mon, 12 May 2008 16:49:02 +0200
Hi Mike,
thanks a lot for that hint.
I will try this instantly.
Best regards,
Helmut
Am 12.05.2008 um 15:52 schrieb Mike Schrag:
which indicates that the primary key has already been used.
Is it a "bad" practice to use the standard EO way to create my
datasets in migration e.g.
User user = new User();
ec.insertObject(user);
user.set...
...
ec.saveChanges();
This would set the correct PK's and then everything works fine.
Yes, very bad ... When that migration runs, it is very possible that
it does not match the current version of your EOModel. For
instance, imagine that you add an extra not-null attribute to your
User entity. So you are inserting in migration 1 out of 5, and the
new attribute was added in version 5. EOModels are unversioned and
thus ALWAYS match the latest migration version, so the model is
going to attempt to insert a User with this additional attribute
which doesn't exist yet in the version of the table that your
migration is running on.
Generally this is an issue of initial data insertion (i.e. the
"Migration Zero" data). You need to wait till all migrations run,
so your databases match your models and THEN run these inserts
against EOF. The way to do this is by implementing
IERXPostMigration on your migration. When all migrations finish
running, it then takes the list of post migrations and executes
them. There are some caveats about post migrations and transactions
that I believe is documented in the package.html for migrations that
you should be aware of.
ms
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden