Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2014-02

TSQLQuery UniDirectional and SaveToStream

5 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Dimitrios Chr. Ioannidis

Hi all,

i will appreciate a little help / advice / anything for the following problem i'm having.

I need to use the xmldatapacketreader to transfer datasets between free pascal and delphi.

The problem i'm having is that i can't use UniDirectional and SaveToStream at the same time ( getting DataBaseError(SUniDirectional) ) and for big datasets the memory goes .....

So, does anyone have any idea how to use xmldatapacketreader ( which implies SaveToStream ) and UniDirectional ?

Best Regards,

Dimitrios Chr. Ioannidis

Reply by email

LacaK
to Dimitrios Chr. Ioannidis

Dimitrios Chr. Ioannidis wrote / napísal(a):

Show quoted text 15 lines
Hi all, i will appreciate a little help / advice / anything for the following problem i'm having. I need to use the xmldatapacketreader to transfer datasets between free pascal and delphi. The problem i'm having is that i can't use UniDirectional and SaveToStream at the same time ( getting DataBaseError(SUniDirectional) ) and for big datasets the memory goes ..... So, does anyone have any idea how to use xmldatapacketreader ( which implies SaveToStream ) and UniDirectional ?

As you can see there is CheckBiDirectional in the begining of SaveToStream ...
I am not sure, why is there such check (may be that bookmarks are used and bookmarks are not supported by unidirectional datasets?) AFAIU saving is performed in sequential order from first record to last ... and update buffer is evaluated, but unidirectional dataset can not have update buffer ... so at first look it seems, that saving can be performed also on unidirectional dataset (as it supports First and Next methods)
May be that CheckBiDirectional is there only for symmetricity with LoadFromStream ... and LoadFromStream can not be performed on UniDirectional datasets. (because they are not updateable and do not handle cached updates)

What you can do is remove check: CheckBiDirectional in the begining of SaveToStream ant try what happens ;-)

-Laco.

Reply by email

Dimitrios Chr. Ioannidis
to LacaK

Hi,

Στις 6/2/2014 9:10 πμ, ο/η LacaK έγραψε:

Show quoted text 25 lines
Dimitrios Chr. Ioannidis wrote / napísal(a): > The problem i'm having is that i can't use UniDirectional and > SaveToStream at the same time ( getting > DataBaseError(SUniDirectional) ) and for big datasets the memory goes > ..... > > So, does anyone have any idea how to use xmldatapacketreader ( which > implies SaveToStream ) and UniDirectional ? > As you can see there is CheckBiDirectional in the begining of SaveToStream ... I am not sure, why is there such check (may be that bookmarks are used and bookmarks are not supported by unidirectional datasets?) AFAIU saving is performed in sequential order from first record to last ... and update buffer is evaluated, but unidirectional dataset can not have update buffer ... so at first look it seems, that saving can be performed also on unidirectional dataset (as it supports First and Next methods) May be that CheckBiDirectional is there only for symmetricity with LoadFromStream ... and LoadFromStream can not be performed on UniDirectional datasets. (because they are not updateable and do not handle cached updates) What you can do is remove check: CheckBiDirectional in the begining of SaveToStream ant try what happens ;-)

Thx for the hint.

I already tried that with no success. There is a lot more involved reg. the ScrollResult of the UniDirectional instance of the BufDataset.

So i just used the TXMLXSDExporter from the DataExport. At least for the simple dataset i want to transfer it's ClientDataSet export format is working fine.

thx,

Dimitrios Chr. Ioannidis

Reply by email

Dimitrios Chr. Ioannidis
to LacaK: Dimitrios Chr. Ioannidis wrote / napísal(a): As you can see there is CheckBiDirectional…

Hi,

Στις 6/2/2014 9:10 πμ, ο/η LacaK έγραψε:

Show quoted text 21 lines
Dimitrios Chr. Ioannidis wrote / napísal(a): > Hi all, > > i will appreciate a little help / advice / anything for the following > problem i'm having. > > I need to use the xmldatapacketreader to transfer datasets between > free pascal and delphi. > > The problem i'm having is that i can't use UniDirectional and > SaveToStream at the same time ( getting > DataBaseError(SUniDirectional) ) and for big datasets the memory goes > ..... > > So, does anyone have any idea how to use xmldatapacketreader ( which > implies SaveToStream ) and UniDirectional ? > As you can see there is CheckBiDirectional in the begining of SaveToStream ... I am not sure, why is there such check (may be that bookmarks are used and bookmarks are not supported by unidirectional datasets?)

by the way, one of the uses of a unidirectional dataset, is the sequential manipulation of big datasets. One of those manipulation is to transform the data while exporting them. So IMHO it will be nice to undone the invalidation of the SaveToStream method for the UniDirectional datasets.

May be a feature request ?

regards,

Dimitrios Chr. Ioannidis

Reply by email

LacaK
to Dimitrios Chr. Ioannidis

Dimitrios Chr. Ioannidis wrote / napísal(a):

Show quoted text 32 lines
Hi, Στις 6/2/2014 9:10 πμ, ο/η LacaK έγραψε: > Dimitrios Chr. Ioannidis wrote / napísal(a): >> Hi all, >> >> i will appreciate a little help / advice / anything for the >> following problem i'm having. >> >> I need to use the xmldatapacketreader to transfer datasets between >> free pascal and delphi. >> >> The problem i'm having is that i can't use UniDirectional and >> SaveToStream at the same time ( getting >> DataBaseError(SUniDirectional) ) and for big datasets the memory >> goes ..... >> >> So, does anyone have any idea how to use xmldatapacketreader ( which >> implies SaveToStream ) and UniDirectional ? >> > As you can see there is CheckBiDirectional in the begining of > SaveToStream ... > I am not sure, why is there such check (may be that bookmarks are > used and bookmarks are not supported by unidirectional datasets?) by the way, one of the uses of a unidirectional dataset, is the sequential manipulation of big datasets. One of those manipulation is to transform the data while exporting them. So IMHO it will be nice to undone the invalidation of the SaveToStream method for the UniDirectional datasets. May be a feature request ?

I think so also ;-)
-Laco.

Reply by email