Re: Weird sql generation problem running migration from WO5.4 (Oracle)
Re: Weird sql generation problem running migration from WO5.4 (Oracle)
- Subject: Re: Weird sql generation problem running migration from WO5.4 (Oracle)
- From: Chuck Hill <email@hidden>
- Date: Tue, 16 Dec 2008 10:29:11 -0800
What should this SQL be?
Caused by: java.lang.RuntimeException: Failed to execute 'alter
table CRS null SCRNV NUMBER'.
Chuck
On Dec 15, 2008, at 7:25 PM, Richard Stephens wrote:
Hi
I'm running 10.5 with WO5.4.3 installed in the default location, and
5.3.3 installed in /Developer/WebObjects53. I am doing all of my
development work against 5.4 but I have 5.3 available should I run
into problems. This project uses oracle as the database. Most of
the projects I work with are still being deployed on 5.3.3. I have
latest WONDER installed for both 5.4 and 5.3, and I experience this
problem with both the apple and WONDER oracle plugins.
Today I needed to do a very simple migration:
public class Migration15 extends ERXMigrationDatabase.Migration {
@Override
public NSArray<ERXModelVersion> modelDependencies() {
return null;
}
@Override
public void downgrade(EOEditingContext editingContext,
ERXMigrationDatabase database) throws Throwable {
// DO NOTHING
}
@Override
public void upgrade(EOEditingContext editingContext,
ERXMigrationDatabase database) throws Throwable {
ERXMigrationTable tbl = database.existingTableNamed("CRS");
tbl.newIntegerColumn("SCRNV", true);
tbl.addForeignKey("SCRNV", "CRS", "CDATID");
}
}
On 5.3.3, this works exactly as expected. On 5.4.3, the migration
fails and I get these messages on the console:
Dec 16 13:05:19 sf_admin[61447] (ERXNSLogLog4jBridge.java:46) DEBUG
NSLog - Finished initialization after launch: ERXExtensions
Dec 16 13:05:19 sf_admin[61447] (ERXNSLogLog4jBridge.java:46) DEBUG
NSLog - Finished initialization after launch: Ajax
Dec 16 13:05:19 sf_admin[61447] (ERXNSLogLog4jBridge.java:46) DEBUG
NSLog - Finished initialization after launch: ERPrototypes
Welcome to sf_admin!
Dec 16 13:05:19 sf_admin[61447] (ERXModelGroup.java:131) WARN
er.extensions.eof.ERXModelGroup - Clearing previous class
descriptions
Dec 16 13:05:20 sf_admin[61447] (ERXModelGroup.java:903) WARN
er.extensions.eof.ERXModelGroup - The EOModel 'erprototypes' has an
empty connection dictionary.
Dec 16 13:05:23 sf_admin[61447] (ERXMigrator.java:454) INFO
er.extensions.migration.ERXMigrator - Upgrading sf to version 15
with migration 'au.edu.sf.migration.Migration15@5c960e'
Dec 16 13:05:23 sf_admin[61447] (ERXJDBCUtilities.java:646) INFO
er.extensions.jdbc.ERXJDBCUtilities - Executing alter table CRS
null SCRNV NUMBER
Dec 16 13:05:23 sf_admin[61447] (ERXApplication.java:1102) ERROR
er.extensions.appserver.ERXApplication - sf_admin failed to start.
er.extensions.migration.ERXMigrationFailedException: Migration failed.
at er.extensions.migration.ERXMigrator
$ERXMigrationAction.doPerform(ERXMigrator.java:473)
at er.extensions.eof.ERXEOAccessUtilities
$ChannelAction.perform(ERXEOAccessUtilities.java:1457)
at
er.extensions.migration.ERXMigrator.migrateToLatest(ERXMigrator.java:
201)
at
er
.extensions
.appserver.ERXApplication.finishInitialization(ERXApplication.java:
1003)
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:
1229)
at er.extensions.appserver.ERXApplication.run(ERXApplication.java:
1098)
at com.webobjects.appserver.WOApplication.main(WOApplication.java:
548)
at er.extensions.appserver.ERXApplication.main(ERXApplication.java:
631)
at au.edu.sf.admin.Application.main(Application.java:62)
Caused by: java.lang.RuntimeException: Failed to execute 'alter
table CRS null SCRNV NUMBER'.
at
er
.extensions
.jdbc.ERXJDBCUtilities.executeUpdateScript(ERXJDBCUtilities.java:653)
at
er
.extensions
.jdbc.ERXJDBCUtilities.executeUpdateScript(ERXJDBCUtilities.java:613)
at
er
.extensions
.migration.ERXMigrationColumn.create(ERXMigrationColumn.java:388)
at
er
.extensions
.migration.ERXMigrationTable._newColumn(ERXMigrationTable.java:224)
at
er
.extensions
.migration.ERXMigrationTable.newColumn(ERXMigrationTable.java:269)
at
er
.extensions
.migration.ERXMigrationTable.newIntegerColumn(ERXMigrationTable.java:
393)
at au.edu.sf.migration.Migration15.upgrade(Migration15.java:24)
at er.extensions.migration.ERXMigrationDatabase
$Migration.upgrade(ERXMigrationDatabase.java:444)
at er.extensions.migration.ERXMigrator
$ERXMigrationAction.doPerform(ERXMigrator.java:456)
... 16 more
Caused by: java.sql.SQLException: ORA-01735: invalid ALTER TABLE
option
at
oracle
.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745)
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:210)
at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:
961)
at
oracle
.jdbc
.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:
1190)
at
oracle
.jdbc
.driver.OracleStatement.executeUpdateInternal(OracleStatement.java:
1657)
at
oracle
.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:1626)
at
er
.extensions
.jdbc.ERXJDBCUtilities.executeUpdateScript(ERXJDBCUtilities.java:649)
... 24 more
Dec 16 13:05:23 sf_admin[61447] (ERXNSLogLog4jBridge.java:43) WARN
NSLog - A fatal exception occurred: Migration failed.
[2008-12-16 13:5:23 EST] <main>
er.extensions.migration.ERXMigrationFailedException: Migration failed.
at er.extensions.migration.ERXMigrator
$ERXMigrationAction.doPerform(ERXMigrator.java:473)
at er.extensions.eof.ERXEOAccessUtilities
$ChannelAction.perform(ERXEOAccessUtilities.java:1457)
at
er.extensions.migration.ERXMigrator.migrateToLatest(ERXMigrator.java:
201)
at
er
.extensions
.appserver.ERXApplication.finishInitialization(ERXApplication.java:
1003)
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:
1229)
at er.extensions.appserver.ERXApplication.run(ERXApplication.java:
1098)
at com.webobjects.appserver.WOApplication.main(WOApplication.java:
548)
at er.extensions.appserver.ERXApplication.main(ERXApplication.java:
631)
at au.edu.sf.admin.Application.main(Application.java:62)
Caused by: java.lang.RuntimeException: Failed to execute 'alter
table CRS null SCRNV NUMBER'.
at
er
.extensions
.jdbc.ERXJDBCUtilities.executeUpdateScript(ERXJDBCUtilities.java:653)
at
er
.extensions
.jdbc.ERXJDBCUtilities.executeUpdateScript(ERXJDBCUtilities.java:613)
at
er
.extensions
.migration.ERXMigrationColumn.create(ERXMigrationColumn.java:388)
at
er
.extensions
.migration.ERXMigrationTable._newColumn(ERXMigrationTable.java:224)
at
er
.extensions
.migration.ERXMigrationTable.newColumn(ERXMigrationTable.java:269)
at
er
.extensions
.migration.ERXMigrationTable.newIntegerColumn(ERXMigrationTable.java:
393)
at au.edu.sf.migration.Migration15.upgrade(Migration15.java:24)
at er.extensions.migration.ERXMigrationDatabase
$Migration.upgrade(ERXMigrationDatabase.java:444)
at er.extensions.migration.ERXMigrator
$ERXMigrationAction.doPerform(ERXMigrator.java:456)
... 16 more
Caused by: java.sql.SQLException: ORA-01735: invalid ALTER TABLE
option
at
oracle
.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745)
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:210)
at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:
961)
at
oracle
.jdbc
.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:
1190)
at
oracle
.jdbc
.driver.OracleStatement.executeUpdateInternal(OracleStatement.java:
1657)
at
oracle
.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:1626)
at
er
.extensions
.jdbc.ERXJDBCUtilities.executeUpdateScript(ERXJDBCUtilities.java:649)
... 24 more
_______________________________________________
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
--
Chuck Hill Senior Consultant / VP Development
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
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