Re: Order of Objects Saved to DB
Re: Order of Objects Saved to DB
- Subject: Re: Order of Objects Saved to DB
- From: Dawn Lockhart <email@hidden>
- Date: Mon, 12 Jan 2009 17:14:46 -0500
- Thread-topic: Order of Objects Saved to DB
Thanks, I'll try that.
I guess I should have mentioned that I am writing to a DB table owned by
another system and they want me to insert the records in a specific order.
Unfortunately, I have no control over the DB table design. They actually do
have a sequence number column in the DB table, but are not using it.
Thanks!
Dawn
On 1/12/09 5:03 PM, "Kieran Kelleher" <email@hidden> wrote:
> First thought out of my head would be to try using
> primaryKeyForTransaction() (spelled sth like that) in Wonder's
> ERXGenericRecord in awakeFromInsertion ..... if awakeFromInsertion is
> too early to call that, then look for some of the other State
> Transition methods in Wonder's ERXGenericRecord that can be used to
> trigger that method call to generate and assign the primary key before
> the record is ever saved. Now if never saved you will have used up a
> PK that won't be reallocated .... but who cares if you are not going
> beyond 2.1 billion or wtahever the mac INT is.
>
> On Jan 12, 2009, at 4:17 PM, Dawn Lockhart wrote:
>
>> I am creating new EO objects and I need them to be saved to the DB
>> in the
>> same order that they were created so their primary keys will be in
>> the order
>> created. It seems like when I call saveChanges on the editing
>> context that
>> the records are just being saved to the DB all willy nilly.
>>
>> It looks like the only way to enforce this is to do multiple calls to
>> saveChanges which I'd like to avoid.
>>
>> Is there some way to have it save a group of objects in the order
>> created?
>>
>> TIA,
>> Dawn
>>
>> _______________________________________________
>> 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
>
_______________________________________________
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