Re: WOLips nightly: generated SQL missing spaces
Re: WOLips nightly: generated SQL missing spaces
- Subject: Re: WOLips nightly: generated SQL missing spaces
- From: Chuck Hill <email@hidden>
- Date: Thu, 1 Nov 2007 15:30:04 -0700
On Nov 1, 2007, at 3:21 PM, Art Isbell wrote:
On Nov 1, 2007, at 11:30 AM, Mike Schrag wrote:
Are you using an external FB plugin? I have a vague recollection
that there is a FrontBasePlugin bundled inside of WO 5.4 ...
Presumably that one works properly because it would be using the
new API's.
Good clues. The WO 5.3 JavaDoc contains no FrontBasePlugin class
unlike the WO 5.4 JavaDoc, so this suggests that WO 5.4 includes a
FrontBase plugin.
My WO 5.3 projects include an external FrontBasePlugin from
FrontBase (it's in /Library/Frameworks/FrontBasePlugin.framework).
When I migrated my WO 5.3/Xcode 2 projects to WO 5.4/Eclipse, I
configured their build paths using the same frameworks.
Apparently, the external FrontBase plugin is used rather than the
internal version. I can't find a way to change that without
removing the external plugin from the build path. Using the
external plugin, the SQL generated is:
-- The 'Drop Primary Key Support' option is unavailable.;
DROP TABLE "PERSON" CASCADE;
CREATE TABLE "PERSON" (
"COMMENT" VARCHAR(1024),
"EMAILADDRESS" VARCHAR(40) NOT NULL,
"FIRSTNAME" VARCHAR(20) NOT NULL,
"FULLNAME" VARCHAR(41) NOT NULL,
"ID" INTEGER NOT NULL,
"LASTEMAILED" TIMESTAMP,
"LASTNAME" VARCHAR(20) NOT NULL,
"LASTUPDATE" TIMESTAMP,
"LASTUPDATECOMMENT" TIMESTAMP,
"LASTUPDATESTATUS" TIMESTAMP,
"LOCATIONID" INTEGER,
"REMINDINTERVAL" INTEGER NOT NULL,
"REMINDUNITS" VARCHAR(10) NOT NULL,
"REMINDMESSAGE" VARCHAR(1024),
"STARTREMIND" INTEGER NOT NULL,
"STARTUNITS" VARCHAR(10) NOT NULL,
"ROMEID" VARCHAR(10) NOT NULL,
"STATUSID" INTEGER,
"TERMINATIONDATE" TIMESTAMP,
"TIMEZONE" VARCHAR(30),
"WANTSNOTIFICATION" BOOLEAN NOT NULL,
"WORKPHONE" VARCHAR(40) NOT NULL
);
SET UNIQUE = 1000000 FOR "PERSON";
ALTER TABLE "PERSON" ADD PRIMARY KEY ("ID") NOT DEFERRABLE
INITIALLY IMMEDIATE;
ALTER TABLE "PERSON" ADD FOREIGN KEY ("STATUSID") REFERENCES
"LOCATION" ("ID") DEFERRABLE INITIALLY DEFERRED;
ALTER TABLE "PERSON" ADD FOREIGN KEY ("LOCATIONID") REFERENCES
"LOCATION" ("ID") DEFERRABLE INITIALLY DEFERRED;
When I remove FrontBasePlugin.framework from the build path, the
SQL generated for the same table is:
DROP TABLE PERSON CASCADE;
CREATE TABLE PERSON ("COMMENT" VARCHAR(1024), "EMAILADDRESS" VARCHAR
(40)NOT NULL, "FIRSTNAME" VARCHAR(20)NOT NULL, "FULLNAME" VARCHAR
(41)NOT NULL, "ID" INTEGERNOT NULL, "LASTEMAILED" TIMESTAMP,
"LASTNAME" VARCHAR(20)NOT NULL, "LASTUPDATE" TIMESTAMP,
"LASTUPDATECOMMENT" TIMESTAMP, "LASTUPDATESTATUS" TIMESTAMP,
"LOCATIONID" INTEGER, "REMINDINTERVAL" INTEGERNOT NULL,
"REMINDUNITS" VARCHAR(10)NOT NULL, "REMINDMESSAGE" VARCHAR(1024),
"STARTREMIND" INTEGERNOT NULL, "STARTUNITS" VARCHAR(10)NOT NULL,
"ROMEID" VARCHAR(10)NOT NULL, "STATUSID" INTEGER, "TERMINATIONDATE"
TIMESTAMP, "TIMEZONE" VARCHAR(30), "WANTSNOTIFICATION" BOOLEANNOT
NULL, "WORKPHONE" VARCHAR(40)NOT NULL);
/* The 'Create Primary Key Support' option is unavailable. */;
ALTER TABLE PERSON ADD PRIMARY KEY (ID);
ALTER TABLE PERSON ADD CONSTRAINT PERSON_status_FK FOREIGN KEY
(STATUSID) REFERENCES LOCATION (ID);
ALTER TABLE PERSON ADD CONSTRAINT PERSON_location_FK FOREIGN KEY
(LOCATIONID) REFERENCES LOCATION (ID);
Not only is the CREATE TABLE SQL invalid because of a lack of
field separation space characters, but I wonder whether the lack of
the various DEFERRABLE INITIALLY * clauses will result in
unexpected behavior.
OUCH! OUCH! OUCH! That will certainly cause problems with inserts
and deletes as the ordering from EOF does not always maintain
referential integrity until the commit. MS SQL does not support
DEFERRABLE constraints and I had to write a special ordering DB
context delegate to be able to use it with EOF.
Also, I wonder whether not setting the primary key sequence value
will matter. Note that the external FrontBase plugin that I'm
using is from 2006, so it's not as new as it might be. If I had a
newer version, the SQL generated might be more similar to that
generated by the internal plugin.
I think the PK sequences will be OK, they will just start at the
default 1 instead of 1000000. I don't thing there have been any
changes to FB or the plugin that would make what 5.4 is generating OK.
So I'd conclude that the SQL generation bug must be a WO 5.4 bug
that can be worked around by using an external plugin (at least for
FrontBase).
That statement sounds correct to me.
Chuck
--
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