Re: EOF inserts PK automatically
Re: EOF inserts PK automatically
- Subject: Re: EOF inserts PK automatically
- From: "Sako!" <email@hidden>
- Date: Fri, 19 Nov 2004 10:33:04 +0100
----- Original Message -----
From: "Marek Wawrzyczny" <email@hidden>
To: "Sako!" <email@hidden>; "Ruenagel, Frank"
<email@hidden>
Cc: <email@hidden>; <email@hidden>
Sent: Wednesday, November 17, 2004 11:37 PM
Subject: Re: EOF inserts PK automatically
>
> On 11/11/2004, at 04:39, Ruenagel, Frank wrote:
> >>> Actually as far as I can tell, the EO_PK_TABLE is not the table that
> >>> WebObjects uses to get the next PK. It's easy to test this. On a
> >>> development (not your production) database, start up your
> >>> application,
> >>> create some records in a table of your choice (either through another
> >>> application or through the database) and don't update the
> >>> EO_PK_TABLE.
> >>> EOF will still generate records with the correct PK. In fact you can
> >>> drop the entire EO_PK_TABLE table altogether and WebObjects will
> >>> still
> >>> happily create it and keep on working.
> >>>
> >>> I am not sure what EOF needs EO_PK_TABLE for, but it does not seem to
> >>> need it for the generation of PKs. I remember reading on Omnigroup
> >>> that
> >>> EOF always gets the max() value on the PK column prior to generating
> >>> the PK. You are always guaranteed to get a unique PK for your
> >>> records.
> >>>
> >> Wrong. Make a test.
> >
> > Well, it is quarter true. ;-)
> > If EOF uses the standard-mechanism of PK-Generation as it is
> > implemented
> > in the jdbc-adaptor:
> > EOF uses EO_PK_Table if it exists. If EO_PK_Table is not there,
> > it will be rebuild on demand. And "demand" means: insert a new row.
> > If the table-name of a table in which a new pk should be inserted is
> > not
> > listed in the EO_PK_TABLE-table, the correspondig row in EO_PK_TABLE
> > will be
> > created.
> > In this case EOF uses a max(pk)-query.
> > This means: EOF works fine without EO_PK_Table. Deleting lines in the
> > table
> > or
> > dropping the whole table does not affect functionality.
> > I have tested this with the ms-sql-adaptor, which uses the default
> > implementation
> > of pk-generation.
>
> I know this is late, but hopefully this will help Sako.
later is much better than never.
>Yeah, I should
> have tested that. Mind you, seems like no one here is quite right.
> According to the Apple docs (why didn't I Google to begin with?), WO
> uses different PK generation mechanisms for different databases. For
> example, the EO_PK_TABLE is not used at all with Oracle. It also
> provides hooks for generating PKs. For an overview goto:
>
> http://developer.apple.com/documentation/WebObjects/Enterprise_Objects/
> Saving/chapter_8_section_5.html
if you read my first or second post, you will mention i use MS-SQL.
and tipically Apple talks about all the world ECCEPT MS-SQL.
"Apple hates Microsoft" why do i wonder?
Mention this sentence in the site:
" It doesn't work if the database includes rows that are inserted by
non-Enterprise Objects applications."
so what the hell do i have as a solution then? non.
this sentence tells me i have to forget the PK feature in EOF.
Ok fine. my first question was and still: how can i force EOF to stop
trying to use this week pk feature(s)?
>
> PK generation example is found here:
>
> http://developer.apple.com/documentation/WebObjects/Enterprise_Objects/
> Saving/chapter_8_section_7.html#//apple_ref/doc/uid/TP30001011-
> DontLinkChapterID_14-TPXREF153
>
thanks, good example,
> And even compound PKs can be implemented:
>
> http://developer.apple.com/documentation/WebObjects/Enterprise_Objects/
> Saving/chapter_8_section_8.html#//apple_ref/doc/uid/TP30001011-
> DontLinkChapterID_14-BADJEBIB
>
fine article
> So nothing appears impossible.
my situation is still impossible.
>
>
> Marek Wawrzyczny
Sako.
ps: Apple should know. not all the world works with oracle, and i know
nobody works with OpenBase.
i write that cos i saw your website :)
Pease Dude!
>
> software engineer
> -------------------------->
> ish group pty ltd
> http://www.ish.com.au
> 7 Darghan St Glebe 2037 Australia
> phone +61 2 9660 1400 fax +61 2 9660 7400
>
>
>
_______________________________________________
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