Page 1 of 1

TUniQuery, Clone with datas

Posted: Mon 21 Feb 2011 09:00
by norwegen60
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

Posted: Mon 21 Feb 2011 11:14
by AlexP
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.

Posted: Mon 21 Feb 2011 13:44
by norwegen60
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.

Posted: Mon 21 Feb 2011 15:20
by AlexP
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.

Posted: Sat 09 Apr 2011 00:48
by kamiller42
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.

Posted: Sat 09 Apr 2011 03:32
by kamiller42
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.

Posted: Sat 09 Apr 2011 08:02
by kamiller42
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.