Subject Re: [IBO] Failed to post all datasets?
Author Geoff Worboys
> What happens is that when I first start the application
> (the form can be destroyed and re-instantiated several times
> without repeating the effect), insert a new record,
> and then click on OK or Apply, I always get a "Failed to post
> all Datasets" exception, and the Dataset remains in Insert state.
> When I click the same button again, the new record is posted
> and the transaction is commited as it should.

Are you able to give us the callstack from when you get the error?

If it is only happening when the form is first starting up it must be
some sort of startup sequence error. I would be looking at places
where you have links to other forms or modules in the application and
seeing when/how these are applied. Check for FormCreate (or
constructor) code and see what is happening there.

The error you describe happens in a transaction function called
SysPostAll. It is simply a result of...

for each dataset
begin
if needtopost
post
inc(counter)
end
if (PostPendingCount - counter) > 0 then
exception - all datasets not posted

PostPendingCount is a counter that is kept to track datasets that the
transaction decides need to be posted. So if loop described above
does not find that many datasets which need to be posted then
something has gone missing.


Geoff Worboys
Telesis Computing