Subject | Re: [firebird-support] Bad design causing problems |
---|---|
Author | Rik Barker |
Post date | 2006-05-24T16:16:23Z |
Hi Woody,
Thanks for replying.
avoid because of the bottleneck it will create on inserts. The example
I've shown is one of 4 inserts done (all with preceding selects). 10
threads all inserting at once is really pretty nippy. I'd hoped I could
use the database to handle the de-duping so the app could run faster, but I
think my threads are so isolated (as they should be) that I'm suffering the
consequences.
approach. I was evaluating 3 different database engines, and learning SQL
at the same time. I wanted my code to require as little change as possible
so it seemed sensible to put the database specifics in the database. From
the disapproving looks and light chastisement I've been getting, I think I
have some more reading to do. *8)
Cheers,
Rik
Thanks for replying.
> You may be able to fashion a critical section procedure in Delphi thatYep, critical sections are something I'm considering, but I'd hoped to
>your threads share where they make the call to the procedure. This will make
>sure that only one thread accesses the procedure at a time which would
avoid because of the bottleneck it will create on inserts. The example
I've shown is one of 4 inserts done (all with preceding selects). 10
threads all inserting at once is really pretty nippy. I'd hoped I could
use the database to handle the de-duping so the app could run faster, but I
think my threads are so isolated (as they should be) that I'm suffering the
consequences.
> However, that being said, I'm sure you will be berated (or at leastWhen I first wrote it as a stored procedure I thought it was quite a clever
>roundly lectured) on the dangers and pitfalls of using a select procedure
>which modified the data. This is just not something you should do for
>various reasons, not the least of which is introducing a "side-affect" in an
>otherwise ordinary select routine.
approach. I was evaluating 3 different database engines, and learning SQL
at the same time. I wanted my code to require as little change as possible
so it seemed sensible to put the database specifics in the database. From
the disapproving looks and light chastisement I've been getting, I think I
have some more reading to do. *8)
Cheers,
Rik