Re: Back with weird problems: PK generation keeps generating same PK... up to a moment.
Re: Back with weird problems: PK generation keeps generating same PK... up to a moment.
- Subject: Re: Back with weird problems: PK generation keeps generating same PK... up to a moment.
- From: "ocs.cz" <email@hidden>
- Date: Sun, 17 May 2015 12:19:36 +0200
Chuck,
> On 14 5 2015, at 2:22 am, Chuck Hill <email@hidden> wrote:
>
> FrontBase will “return” the sequence number if the transaction is rolled back, but I am pretty sure that EOF does a commit immediately after selecting for a PK.
>
> It is possible that somehow the commit after the PK select failed and the exception got eaten, I suppose. That seems a bit far fetched.
Hmmm.... here I might possibly see a way to prevent the problem in future: correct me please if I am wrong, but I understand permanentGlobalID causes this generation (and commit), right?
Well then, what if I, at the moment any EO gets inserted into an EC, immediatelly called permanentGlobalID for it?
Unless I am overlooking something, it should get, commit and assign a safe PK for the EO. Later, when the EO gets saved, no PK clash would be possible.
About the only drawback I can see is that when generating lots of new EOs, there would be many unnecessary roundtrips to the DB and it would be sloow. But normally I create at worst tens (normally just a couple) of EOs inside a r/r loop, and batch imports etc. need to be optimised separately anyway.
Might this be a solution? Or am I overlooking something of importance, as so often?
Thanks a lot,
OC
_______________________________________________
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