![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| ||||
| ||||
|
|
Hello, I have noticed that my ESQLC connection to an Ingres database works asynchronously. |
|
When issuing dozens of insert-statements then my ESQLC calls return really fast while the Ingres database apparently still works on the inserts and finishes them seconds after my calls. |
|
This is rather bad behavior when I'm relying on finished sql statements. |
|
I've found that one can configure OpenAPI to work synchronously, but how to do this with ESQLC ? Is there any default dbevent that is triggered when a insert/delete/update/... statement finishes? |
#3
| |||
| |||
|
|
Hello, I have noticed that my ESQLC connection to an Ingres database works asynchronously. Is this the default behavior? When issuing dozens of insert-statements then my ESQLC calls return really fast while the Ingres database apparently still works on the inserts and finishes them seconds after my calls. |
#4
| |||
| |||
|
#5
| |||
| |||
|
|
Walter, You probably have fast-commit, write behind configured for your ingres server. |
|
Caveat... Microsoft... beware of disk caching enabled on hard drives... unless you know how to overcome power cuts (or have set the extra ingres logical)... |
#6
| |||
| |||
|
|
At 10:49 AM +0200 9/2/05, Walter Quirtmair wrote: Hello, I have noticed that my ESQLC connection to an Ingres database works asynchronously. Is this the default behavior? When issuing dozens of insert-statements then my ESQLC calls return really fast while the Ingres database apparently still works on the inserts and finishes them seconds after my calls. What makes you think that? Embedded SQL is synchronous. The IIsyncup() calls you see in the preprocessed code flush the query to the DBMS and wait for a response. I can't say I've ever seen it act as you describe. Karl |
#7
| ||||||
| ||||||
|
|
Thanks for your answer. Actually I have a strange behavior which can only be explained when thinking that ESQLC works asynchronously: |
|
I have a window in my app that display simple data which comes from a table in an Ingres DB. When clicking on "Save" I'm deleting all content of that table and recreate it completely with inserts inside a loop. Now our customers reported that they always get a duplication of the rows with each click on Save. Finally we could reproduce the problem only when clicking Save more than once *really fast*. Then not all but many of the rows suddenly are inserted twice, in turn results in many duplicate rows. |
|
The code behind that action is very basic and simple. We finally came to the conclusion that ESQLC must return from the insert-statements almost immediately while the database is still working on that data. |
|
In the meantime the second click sends the same data to the DB which then will produce the duplicated rows. |
|
Strange enough the second delete statement must be executed before the inserts, which explains why not all rows are duplicated. |
|
This sounds strange and it is - when working in a "normal" pace this never happens. Only when clicking Save and then OK in the window (which performs a Save as well) fast, this will lead to the problem. And that's exactly how our customer works... To solve the problem I have rewritten the code and now I'm doing a bulk copy from a file. The problem never could be reproduced since then. Still I wonder what's the reason for the reported problem. I have no clue... Besides: it's OpenIngres 2.0 from 1999. I know this is a old version, but there's no chance to upgrade that for various reasons. And Ingres is not that fast, really. We work over a LAN and that alone means slower actions by a factor of approx. 10! |
![]() |
| Thread Tools | |
| Display Modes | |
| |