[fpc-pascal] Dataset modification and reading at the same time

Felipe Monteiro de Carvalho felipemonteiro.carvalho at gmail.com
Tue Oct 6 01:03:13 CEST 2009


On Mon, Oct 5, 2009 at 3:24 PM, David Emerson <dle3ab at angelbase.com> wrote:
> Maybe you could do a sync operation or some such, to force changes to be
> written to disk. It would probably slow the system down, but you might
> be able to get it to work.

Yes, but that's quite ineficient. I already have the data in memory,
why write it to disk and read it again?

My current solution is setting TDataSource.Enabled to false before
reading and store the current record and after finishing the read go
to the original record and enable the data source. Controlling to read
as few times as possible it doesn't interfere much with the user
editing.

The whole problem is that I wish to have 2 current record pointers in
the same database instead of only one, but that seams impossible with
the current TSFDDataset. Maybe it's possible by extending it so that
you can create a TSDFDataset which shares the memory of another
already created one. If this second only does reading there should be
no problem.

And while talking about TSDFDataset, would a property to decide if
newly inserted records should go after of before the current record be
welcomed? I like to use the standard navigation component and I find
it very user unfriendly to have new records go before the current
record.

thanks,
-- 
Felipe Monteiro de Carvalho



More information about the fpc-pascal mailing list