avoid closing the dataset when losing connection to the data server

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
gss200610
Posts: 35
Joined: Mon 23 May 2016 22:29

avoid closing the dataset when losing connection to the data server

Post by gss200610 » Sat 10 Mar 2018 23:43

doing some tests where:
1 - I define queries as cached update I linked a dbgrid to this query
2 - close the served firebird to simulate drop of connection
3 - when applying apply updates -> dbgrid closes because of the connection crash

5 - Then I put a DataSetProvider and a clientdataset in the form
6 - I connected the dataset provider to uniquery1
7- I connected the clientdataset to the datasetprovider
8- I changed the datasource of dbgrid to the clientdataset
9 - repeat steps 2 and 3 above.
dbgrid only closes if I move the complete data, but if I change a record in question and execute the applyupdates it does not close like using just uniquery with cached, why?

I know I can use disconnected mode, but I have tables with more than 50,000 records, and I noticed that it gets very slow to disturb.
can i use as i did with clientdataset?


Does anyone have a better tip to use with firebird?
fetchall is out of the question here.
disconected mode would be the solution if it were not so slow to open the tables, even with fetchrows set to few records.


how to use tdatasetfield with unidac and clientdataset without being slow to the point of application hang, because even configuring fetchrows and packed records, it takes so long to hang the application. I need a solution that is not using disconected mode because it also leaves the application slow.

gss200610
Posts: 35
Joined: Mon 23 May 2016 22:29

Re: avoid closing the dataset when losing connection to the data server

Post by gss200610 » Sun 11 Mar 2018 12:26

I think it worked, correct me if I'm wrong.
I used localfailover = true
I treated the event onconnection lost to RetryMode: = rmReconnectExecute;
and I used clientdataset linked to uniquery, the detail using the concept datasetfield and I noticed that there was no slowness. Can you use it like that? to work on clientdataset for my purpose?

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: avoid closing the dataset when losing connection to the data server

Post by ViktorV » Tue 13 Mar 2018 09:02

Yes, you found a right solution to the issue: you can use the OnConnectionLost event handler and TClientDataset together to solve your task.

gss200610
Posts: 35
Joined: Mon 23 May 2016 22:29

Re: avoid closing the dataset when losing connection to the data server

Post by gss200610 » Tue 13 Mar 2018 23:40

thank you so much. I need one more tip.
how do I for the clientdataset connected in the uniquery with master detail does not bring all the records and obey the packetrecords, once I put value = 20 in the detail table at a time and this one has 200, it is bringing the 200 and it arrives to lock the screen, how to proceed

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: avoid closing the dataset when losing connection to the data server

Post by ViktorV » Wed 14 Mar 2018 09:55

In order for us to be able to give you a detailed answer, we need to have a sample demonstrating the specified behavior. Therefore, please compose a small sample demonstrating the described behavior and send it to us using the contact form https://devart.com/company/contactform.html, including the scripts for creating database objects.

Post Reply