Subject Re: "Failed to post all datasets" - new observations
Author Jason Wharton
--- In IBObjects@yahoogroups.com, Aage Johansen <aagjohan@...> wrote:
>
>
> In April, I posted this:
> -------------------------------------
> Delphi/2007
> IBO/4.8.7
> Firebird 1.5.4
>
> I've recently encountered (for the first time, and in an old
project)
> the exception E_Failed_To_Post_Datasets: "Failed to post all
datasets".
> It is raised in IB_Components: TIB_Transaction.SysPostAll - at
least,
> that's the only place I found it referenced in the IBO source.
> I'd like to hear any hints about something to check...
>
> It happens when I delete a record from a grid (actually, two grids
> behave like this). It seems to happen only when there are other
rows
> present in the grid - deleting the last rows in a grid works ok.
The
> tables feeding the grids (through TIB_Queries) hold >1mill and
>3mill
> rows, but the selections in the grids are usually just a few rows.
> The TIB_Queries use the same transaction.
> The deletes are initiated through clicking the delete button on a
> TIB_Updatebar.
> Anyway, after clicking the button on the error dialog, the deletes
go
> through sucessfully.
> -------------------------------------
>
> No one responded, but recently I got this comment:
> -------------------------------------
> A little late, but..
> From memory, this happens when you have more than one dataset in
the
> same transaction. For commit to work, they all have to be in the
> same state ie all of them in browse.
> -------------------------------------
>
> I thought this strange, and answered:
> -------------------------------------
> Could this - datasets being in different _states_ - really be a
problem?
> -------------------------------------
>
> And the response was:
> -------------------------------------
> Yes, that's where I have seen it. It was in master/detail linked
> datasets where one was posted and was not (I think) OR one was in
> browse mode and the other in edit.
> I got sick of these errors and have coded the stuff with separate
transactions.
> -------------------------------------
>
>
> Now, I would like to have this confirmed (or not) - if
> possible. Further comments are also welcome!
>
>
> TiA
> Aage J.
>

This error is likely caused because you have event code that is
putting a dataset back into a state that needs to be posted during
the sequence of events when Commit or CommitRetaining is called.

I suggest you get a look at the callstack and see if you can figure
out which dataset has gone back into an edit state and then set a
breakpoint for that dataset that will stop when it is going back
into that state and look at the callstack there. This will give you
the smoking gun.

Jason