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: Fri, 19 Dec 2008 18:08:22 -0800
I was talking to Mike about this and in order to keep Wonder
compatible with both WO 5.3 and 5.4 is quite a bit of effort, not just
adding this one method. I suspect that this is just the tip of the
proverbial iceberg.
Chuck
On Dec 17, 2008, at 8:34 PM, Richard Stephens wrote:
Chuck,
I have filed a bug both in Wonder and with apple.
If you can send me a compiled copy of the modified framework I will
test it, but I don't have the time to grab the Wonder source and
recompile it myself.
-- Regards, Richard Stephens Ph: 07 3136 3426 Mob: 0410 111 570
Email: email@hidden
On 18/12/2008, at 1:48 PM, Chuck Hill wrote:
On Dec 17, 2008, at 5:51 PM, Richard Stephens wrote:
Hey Chuck,
When run with WO5.3 the generated SQL looks like this:
alter table CRS add (SCRNV NUMBER)
ALTER TABLE CRS ADD CONSTRAINT CRS_SCRNV_CDATID_FK FOREIGN KEY
(SCRNV) REFERENCES CRS (CDATID) DEFERRABLE INITIALLY DEFERRED
OK, so... There were some (a lot?) of API changes down at this
level in 5.4 and many of the plugins did not get updated. I
_think_ that OracleSynchronizationFactory in both plugins needs to
implement this:
public String _alterPhraseInsertionClausePrefixAtIndex(int
clauseIndex) {
return "add";
}
The default phrase in EOSchemaSynchronizationFactory is null which
is pretty much guaranteed to never, ever be correct. I don't have
an Oracle instance at hand so I am reluctant to just slap in this
Wonder without testing. Can you go here http://issues.objectstyle.org/jira/secure/Dashboard.jspa
and file an Wonder bug on this.
Chuck
On 17/12/2008, at 4:29 AM, Chuck Hill wrote:
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
--
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
--
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