This should really be on the Wonder list rather than wo-dev, but I
just committed a fix for this ... I saw this once before but didn't
end up looking into it. Is it possible you are depending on another
framework that is bringing in a migration that only is being
discovered because of a relationship to a 3rd model? For instance,
you are declaring Model1 and Model2, but do you have a relationship to
a Model3 that also uses migrations (like ERAttachment or ERTaggable,
maybe?). Anyway, that was the scenario that would cause this ... If
you can track down that 3rd model and list it explicitly in the
modelNames list, it would probably fix the problem for you also, or
you can update Wonder after tonight's build and it should be properly
fixed.
As an aside, you no longer have to declare MigrationClassPrefix for
your models if the class name matches your EOModel name ...
ms
On Apr 6, 2008, at 4:43 PM, Aleksey Novicov wrote:
I love ERXMigration! But I seem to be having a problem when I use it
for multiple models. The models do not have any dependency on each
other, so I don't bother to implement modelDependencies() in either
of my Migration classes.
If I configure the settings so that the migration for only one model
runs, and not the other, everything runs fine. So it seems to be
gagging on the fact there are multiple models. Do I need to
configure some sort of default model dependency, even if there is
none? Both models refer to the same database, and the migrations are
both migration0.
Thanks,
Aleksey
er.migration.migrateAtStartup=true
er.migration.createTablesIfNecessary=true
er.migration.modelNames=Model1,Model2
Model1.MigrationClassPrefix=com.xxx.Model1
Model2.MigrationClassPrefix=com.xxx.Model2
@Override
public void upgrade(EOEditingContext editingContext,
ERXMigrationDatabase database) throws Throwable {
ERXJDBCUtilities.createTablesForModel(database.adaptorChannel(),
database.model());
}
Apr 06 13:18:11 SmalltownAdmin[8888] (ERXNSLogLog4jBridge.java:41)
WARN NSLog - A fatal exception occurred: null
[2008-4-6 13:18:11 PDT] <main>
java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:841)
at java.util.HashMap$KeyIterator.next(HashMap.java:877)
at
er
.extensions
.migration
.ERXMigrator._buildDependenciesForModelsNamed(ERXMigrator.java:236)
at
er.extensions.migration.ERXMigrator.migrateToLatest(ERXMigrator.java:
158)
at
er
.extensions.ERXApplication.finishInitialization(ERXApplication.java:
831)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun
.reflect
.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun
.reflect
.DelegatingMethodAccessorImpl
.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
com
.webobjects.foundation.NSSelector._safeInvokeMethod(NSSelector.java:
122)
at com.webobjects.foundation.NSNotificationCenter
$_Entry.invokeMethod(NSNotificationCenter.java:588)
at
com
.webobjects
.foundation
.NSNotificationCenter.postNotification(NSNotificationCenter.java:532)
at
com
.webobjects
.foundation
.NSNotificationCenter.postNotification(NSNotificationCenter.java:546)
at com.webobjects.appserver.WOApplication.run(WOApplication.java:
1223)
at er.extensions.ERXApplication.run(ERXApplication.java:925)
at com.webobjects.appserver.WOApplication.main(WOApplication.java:
547)
at er.extensions.ERXApplication.main(ERXApplication.java:397)
<HaspMapIterator.png>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/mschrag%40mdimension.com
This email sent to [EMAIL PROTECTED]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]