I've noticed that WO's order of events is to read the lastvalue, then to create
an insert that includes the id. then it updated the sequence. so you can get
out of sequence if you manually inserted any rows and didn't check to make sure
you updated the seq.
that said, i have a table with a sequence and I inserted data using the next
value from the sequence (lastvalue was 9)
insert into table (firstname, id) values ('ted', 10);
it inserted correctly into the user table however because I supplied the id
value, it did not update the sequence. This is documented behavior.
How you got out of sync I don't know. Either you manually added a row, or you
are getting in the way of WO and inserting using raw SQL (you can but you will
have to resolve the primary key).
I don't know if this is the issue. Just my musings
Ted
On Aug 14, 2013, at 6:30 PM, Johnny Miller <[email protected]> wrote:
> Hi,
>
> I'm using a PostgreSQL database and I'm having a problem with the sequence
> not getting updated.
>
> I'm using ERAttachment and I have pages that will generate thumbnails of the
> attachment for specific sizes. And for some reason when creating the
> thumbnail it will not update the sequence for ERAttachment. It stops using
> the sequence to generate the ID and switches over to EO_PK_TABLE so the
> thumbnails get properly saved. But the next time I go to add an attachment I
> get a EO general adapter exception because the sequence is behind the value
> in EO_PK_TABLE which holds the last generated ID.
>
> And it only seems to do this in production on my OS X 10.5.8 server box.
>
> Has anybody seen this before?
>
> Aloha,
> Mr. Johnny Miller
> Web Development Manager
> Kahalawai Media Company
> Lahaina, HI 96761
> tel: (808) 661-7962 | mobile: (808) 283-0791
> website | e-mail
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list ([email protected])
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/tedpet5%40yahoo.com
>
> This email sent to [email protected]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]