Hi Yuri,
I am interested in how you are using auto-increment primary keys. Are the key values really getting assigned on the server and not pulled back from a sequence? My recollection is that EOF won’t save with a null PK, but I could be wrong. If EOF does
not know the PK when it saves, it can’t convert the EOTemporaryGlobalID into a valid, permanent EO*GlobalID. So I can see this working if immediately after saving new objects you drop all references, dispose the EC, and fetch the objects by some other value.
Also, how do you handle FK references if EOF does not know the PK of the other object when it saves?
If you are sharing adding rows to the DB with an non-WO app, both need to be getting the values from a sequence or other DB shared values mechanism.
Chuck
From: Yuri Kondratov < email@hidden>
Date: Saturday, July 18, 2015 at 12:18 PM
To: Chuck Hill < email@hidden>
Cc: WebObjects Development < email@hidden>
Subject: Re: postgresql eomodeler correctly "generate sql"
Hmmm thank you Chuck for that interesting bit. It does make sense not using auto increment in the db with WO.
I understand that this is probably not the proper way and can result in problems but interestingly we’ve been running an application with openbase for over 10 years that uses auto incrementing primary keys and everything seemed to be working
fine. Also a previous small application I made with postgresql used auto incement as well and seemed alright.
What happens if you want to add rows to the db from an external source outside of WO. Then figuring out what the next primary key should be is up to it. Doesn’t that create problems?
I still have problems running the generated sql. I’ll continue to hand build the db (but without using serial datatypes this time) until someone has an answer
On Jul 18, 2015, at 2:25 PM, Chuck Hill < email@hidden> wrote:
Hi Yuri,
Those instructions are 10 years out of date and refer to technologies that no longer exist. Those WikiBook pages only exist because the site owners won’t allow them to be deleted.
AND you can NOT use auto-incrementing columns as primary keys with EOF. That does not work. EOF needs to know the PK when it commits the INSERT statements.
Chuck
Greetings everyone,
This is mostly directed to those that use Postgresql.
I’m using postgresql 9.4. In EOModeler using prototypes. Everything works fine other than when I try to generate sql, it seems to be generating it incorrectly. For example: id is generated with the integer(int4) datatype instead of serial (which
is for autoincrementing). I do see that EOModeler tries to generate sequences which may be an alternative to just having a serial datatype. But never the less, the sql generated doesn’t run. It throws errors.
"Currently the Wonder build server does not autobuild the piece (coming soon). This is only needed for generating SQL out of EOModeler, so if you're just deploying, this isn't necessary. To use the EOModeler Bundle, checkout Project Wonder from
its SourceForge repository (you can just checkout Wonder/PlugIns if you don't want everything). Go into the PostgresPlugInBundle folder and run xcodebuild, or load the project into Xcode and build it from the GUI. This will produce a build/Default/PostgresqlPlugIn.EOMplugin
folder that you can copy into your /Developer/EOMBundles folder. Note that you CANNOT put it into your ~/Devloper/EOMBundles folder because EOModeler decides it doesn't want to look in that folder.” ( https://en.wikibooks.org/wiki/WebObjects/Project_WONDER/Frameworks/PostgresqlPlugin)
I can’t seem to connect to the SourceForge repository so I downloaded the wonder source from github and can’t seem to find the PostgresPlugInBundle folder. I went back and tried finding it in the Wonder 5 Legacy source as well. Still no luck.
I have all the other steps complete such as having the PostgresqlPlugIn.framework in /Library/Frameworks.
Anyone have any answers or suggestions?
|