TUniQuery, Clone with datas

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
norwegen60
Posts: 19
Joined: Wed 15 Dec 2010 13:12

TUniQuery, Clone with datas

Post by norwegen60 » Mon 21 Feb 2011 09:00

Hello together,

sometimes I need two instances of a DB. With ADO I made a ADODataset.clone. In Uniquery I can make

Code: Select all

UniQuery2.Assign(UniQuery1);
UniQuery2.Open;
But the open needs again 18 seconds. Is there a faster way to get a clone from UniQuery1 for example after an insert in UniQuery1?
The long time (18s) is coming from setting the IndexFieldNames to make shure the datas are also sortetd correct after an insert.

Sometimes I need in UniQuery2 only some columns of the table. But UniQuery2 should also be updatetd in a fast way after an insert in UniQuery1. How to do this?

I also tried

Code: Select all

CRBatchMove1.Destination:=VirtualTable1;
CRBatchMove1.Source:=UniQuery1;
CRBatchMove1.mode:=bmAppend;
VirtualTable1.FieldDefs := UniQuery1.FieldDefs;
CRBatchMove1.Execute;
if not VirtualTable1.Active then
  VirtualTable1.Open;
but this needs longer than an assign with following open

best thanks
Gerd
Last edited by norwegen60 on Mon 21 Feb 2011 11:17, edited 1 time in total.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Mon 21 Feb 2011 11:14

Hello,

Unfortunately, we didn't implemente the Clone method.
We will investigate the possibility of adding this feature in one of the next builds/versions of UniDAC.
Now you can use only Assign and Open methods to clone datasets.

norwegen60
Posts: 19
Joined: Wed 15 Dec 2010 13:12

Post by norwegen60 » Mon 21 Feb 2011 13:44

Is there no way to increase the speed? Especialy as the datas are already on the client and I only need a second view on it.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Mon 21 Feb 2011 15:20

Hello,

If you need only to view data, you can try to use the following code::

VirtualTable1.Assign(UniQuery1);
VirtualTable1.Open;

This will increase performance a bit.

kamiller42
Posts: 40
Joined: Thu 27 Jan 2011 22:31

Post by kamiller42 » Sat 09 Apr 2011 00:48

I found this thread in a Google search.

Please add me to the list of those wanting the Clone method implemented. I am looking to convert an Ado app to Devart and need this functionality for the same reason; I am using a data cache.

kamiller42
Posts: 40
Joined: Thu 27 Jan 2011 22:31

Post by kamiller42 » Sat 09 Apr 2011 03:32

I should add that if the feature is added, it should work better than ADO's Clone method. It should work like TClientDataSet's CloneCursor.

kamiller42
Posts: 40
Joined: Thu 27 Jan 2011 22:31

Post by kamiller42 » Sat 09 Apr 2011 08:02

Scratch that last comment. I thought TClientDataSet would automatically update cloned datasets when the source was closed and re-opened. ADO and CDS don't. Figured a workaround for each, but CDS takes a long time to cache the data in D2007. ADO is faster.

Post Reply