Re: EOF inserts PK automatically
Re: EOF inserts PK automatically
- Subject: Re: EOF inserts PK automatically
- From: "Sako!" <email@hidden>
- Date: Mon, 22 Nov 2004 14:31:25 +0100
----- Original Message -----
From: "Anjo Krank" <email@hidden>
To: "Sako!" <email@hidden>
Cc: "Ruenagel, Frank" <email@hidden>;
<email@hidden>
Sent: Monday, November 22, 2004 12:48 PM
Subject: Re: EOF inserts PK automatically
>
> Am 22.11.2004 um 11:36 schrieb Sako!:
>
> > remember the DB see an insert as an atomic unit. All or nothing.
> > EOF works like this.
> > 1. read last PK from EO_PK_Table ex. 30
> > 2. increase col in EO_PK_Table. ex. 31
> > 3. Finish for DB. for now.
> > 4. EOF tries to insert a row with pk.
> > 5. DB
> > a. insertes row
> > b. updates col in EO_PK_Table. with the SAME PK. ex. 31.
> > 6. is 5 Atomic Unit successful? Finish for DB. else Error.
> > over.
>
> Probably. But when you switch 4 and 5, meaning a second process
> successfully inserts (which doesn't care about the EO_PK_TABLE and just
> triggers an increment to it) before EOF is finished, then you're stuck
> - which is just what I wrote.
Sorry i dont understand you!
you mean what will happen weather the EOF increases the number in
EO_PK_Table, and an Error happens during insert? ok usually the number will
be springed.
mean : the number 31 in my example will never be used.
> Of course your trigger on the table will
> update the EO_PK_TABLE, but it's simply too late. You will have EOF
> trying to insert a object with a PK that is already in the DB and I for
> one don't see a good way to recover from there. You can't refault it
> and the only thing you have left is to start over again. Probably.
>
Again dont understand! :(
could you give an example please?
> Again: I may be wrong in that EOF uses a second/prior transaction for
> getting the PK, but I pretty much doubt it. I just don't see a way
> where getting these numbers can be reasonably rolled back...
>
> Cheers, Anjo
pease
Sako.
>
>
>
_______________________________________________
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