Subject Re: [IBO] Where to start debugging. Please help.
Author Helen Borrie
At 10:45 AM 26/05/2004 +0200, you wrote:
>Good day (Retry seems first post did not work)
>=-=-=-==-=-=
>
>I have a program that copies data from the local database
>to target databases over the network. This was first written with
>BDE and I then converted to IBObjects with GReplace. I upadted
>the Queries update statements, gave the database componets
>there own transactions as they will require and ran the program.
>
>BUT I ran into something very weird. In a loop that
>happens every 50 seconds I look for entries in a table that
>must be copies. Copy them and then delete the entry from the table on succes.
>Not to do him again.
>
>The first time this works fine. BUT the SECOND time I get
>a access violation on the DELETE statement.
>
>The calling functions :
>
>//==================================
> DM_SysRepl.qryReplSet.Delete; <<== WHERE SECOND call creates ERROR.
> DM_SysRepl.dbSysRepl.ApplyUpdates([DM_SysRepl.qryReplSet]);
>//===================================

You are getting the error because you are targetting a cache buffer row
that isn't there. ApplyUpdates is a cache method. It doesn't commit
anything. At best, it posts changes to the server (which will subsequently
have to be committed using CommitUpdates) and deletes the rows from the
cache buffer. When you call Delete the second time, you get an AV because
the cache buffer is empty.

Helen