Page 1 of 1

Unidac + Firebird insert very strange slowly

Posted: Tue 03 Jan 2012 17:39
by JRichmann
Hello...

I'am using D2010 + UniDac 4.02 + Firebird on Win7 64 Bit
Insert into a FB DB is strange slowly. Very slowly.

As I see it a first... I thought solution is easy. I have to use Transaction and commit (normally way to make FB fast).

Now I use:

MyConnection.StartTransaction;
MyQuery1.SQL.Text:='select * from '+tablename;
MyQuery1.Open;
while not ....eof.... do begin
MyQuery1.Insert;
MyQuery1.Post;
end;
MyConnection.Commit;

My Problem is: With StartTransaction and Commit it's slowly too.

As I feel: Some is wrong. I looks that MyQuery1 make a commit after each post, becouse there is no speed difference.

What I do wrong ?

Hmmmm: I miss a flag like: MyQuery1.AutoCommit:=false to make sure
that post make no commit hissself.

...Joerg


www.JRichmann.de

Posted: Wed 04 Jan 2012 12:38
by AndreyZ
Hello,

You can check whether commit is performed after each record by replacing the code:

Code: Select all

MyConnection.Commit;
with the code:

Code: Select all

MyConnection.Rollback;
If all changes are cancelled, it means that commit is performed only once. If transaction is commited only once and the performance is still low, it means that in this case performance depends on a Firebird server but not on UniDAC.